Hosting » Azure » How do I run Azure function locally?

How do I run Azure function locally?

Last updated on September 25, 2022 @ 12:23 pm

Azure Functions can be run locally on your computer. To install and run Azure Functions locally, follow these steps:

1. Create a new Azure Function project in your Azure account.

2. In the Functions blade in the Azure portal, select your new project and click the Functions tab.

3. In the Functions blade, select the Functions tab, and then select the Run button.

4. In the Run Azure Function dialog box, type the function name and click the Create button.

5. In the Function output section of the dialog box, select the Use the current folder option, and then type the path to the folder where you want the function to run.

6. In the Environment section of the dialog box, select the Use the current environment option, and then type the name of the Azure environment in which you want to run the function.

7. In the Arguments section of the dialog box, type the arguments you want to pass to the function.

8. In the Start script section of the dialog box, type the code you want to run when the function starts.

9. In the Azure Functions Publish section of the dialog box, click the Publish button.

10. In the Function result pane, click the view links to see the function output.

11. When you’re finished running the function, click the Stop button to stop the function.

12. In the Functions blade, click the Functions tab, and then click the Disconnect button to disconnect from the function.

13. To delete the function, select the function name in the Functions blade, and then click the Delete button.

14. When you’re finished working with the function, close the Functions blade.

Conclusion

In this article, you learned how to create and run a Azure function locally on your computer. You also saw how to use the Function output and Environment sections of the Run Azure Function dialog box to control how the function runs.

PRO TIP: If you are running Azure Functions locally, you need to take care to properly manage your Azure Subscription and Function App settings. Otherwise, you may unintentionally delete or modify critical resources.
Dale Leydon

Dale Leydon

Sysadmin turned Javascript developer. Owner of 20+ apps graveyard, and a couple of successful ones.