A developer needs to configure a local development environment for a lightweight Go application using the Azure Functions Core Tools custom handler feature and test the function locally. Which sequence of steps should the developer perform?
- 1Run 'func init --worker-runtime custom' in the command line.
- 2Run 'func new --template "HTTP trigger" --name GoHandler' to add a new function trigger.
- 3Compile the Go application source code into an executable file named 'handler'.
- 4Modify the 'host.json' file to set the 'defaultExecutablePath' property under the 'customHandler.description' section to 'handler'.
- 5Run 'func start' to launch the Azure Functions host locally.
Answer
The correct sequence is: Run 'func init --worker-runtime custom' in the command line, run 'func new --template "HTTP trigger" --name GoHandler' to add a new function trigger, compile the Go application source code into an executable file named 'handler', modify the 'host.json' file to set the 'defaultExecutablePath' property under the 'customHandler.description' section to 'handler', and finally run 'func start' to launch the Azure Functions host locally.
The correct sequence flows from establishing the local directory layout (init), creating the function trigger metadata (new), generating the executable from Go code (compile), mapping the host to this executable (host.json configuration), and executing the Functions runtime host (start).
Step-by-Step Solution
Key Concept
Azure Functions Custom Handlers configuration and local development lifecycle