Soru

Zorluk: OrtaCreate and Configure Azure Functions

You are developing a new event-driven processing application. You need to create a C# Azure Function named ProcessOrder that uses the Azure Functions V4 runtime and the .NET isolated worker model. The function must run locally on your developer workstation and execute whenever a new message is received in an Azure Queue Storage queue.

Which sequence of actions should you perform to initialize, create, and test the function locally? Arrange the actions in the correct order.

  1. 1Install the Azure Functions Core Tools on the developer workstation.
  2. 2Run the command `func init OrderProcessor --worker-runtime dotnet-isolated` to create the project.
  3. 3Run the command `func new --name ProcessOrder --template "QueueTrigger"` inside the project directory.
  4. 4Run the command `func start` inside the project directory to run the function locally.

Cevap

To configure and run the function locally, you must first install the Azure Functions Core Tools. Next, initialize the local project using the init command with the dotnet-isolated worker runtime. Then, create the new function inside the project directory using the new command with the QueueTrigger template. Finally, start the local runtime host using the start command.
The correct sequence starts with installing the Azure Functions Core Tools, which provides the 'func' CLI. Once installed, a developer must initialize the project structure using 'func init' to create the baseline configuration files. After the project is initialized, the developer can generate the queue-triggered function code using 'func new'. Finally, the developer can start the local development host to run and test the function locally using 'func start'.

Adım Adım Çözüm

1
Install the Azure Functions Core Tools on the developer workstation.
The local system has access to the 'func' CLI and the local Functions runtime host.
This is a prerequisite for creating and running Azure Functions locally.
2
Run the command `func init OrderProcessor --worker-runtime dotnet-isolated`.
A new directory named OrderProcessor is created, containing configuration files such as host.json and local.settings.json.
You must establish a project context before creating specific function triggers.
3
Run the command `func new --name ProcessOrder --template "QueueTrigger"` inside the project directory.
A new function named ProcessOrder is generated with the Queue Trigger template and added to the project.
This creates the function-specific code files and configuration bindings.
4
Run the command `func start` inside the project directory.
The local Azure Functions host starts and begins listening for queue events.
This starts the local runtime environment to test and debug the function.

Anahtar Kavram

Local development workflow of Azure Functions using the Azure Functions Core Tools CLI
Bu soruyu puanla