By now, you know that while authoring Azure Functions, we need to ensure that we also accommodate an App Service plan and a storage account. Let's start authoring the ARM template using Visual Studio:
- Create a new project by choosing Visual C# | Cloud and then choose Azure Resource Group:
- Clicking on the OK button in the previous step will open up the Select Azure Template where you choose the Azure QuickStart (github.com/Azure/azure-quickstart-templates) templates:
- Search for the word function and click on the 101-function-app-create-dynamic template to create the Azure function app with the Consumption plan:
- The required JSON template will be created in Visual Studio. You can learn more about the JSON content at https://docs.microsoft.com/en-us/azure/azure-functions/functions-infrastructure-as-code.
- Deploy the ARM for provisioning the function app and its dependent resources. You can deploy it by right-clicking on the project name (in my case ARMTemplateforFunctionApp), clicking on Deploy, and then clicking on the New button:
- Choose the Subscription, Resource group, and other parameters for provisioning the function app. Choose all the mandatory fields and click on the Deploy button:
- That's it! In a few minutes, the deployment will start and each of the resources mentioned in the ARM JSON templates will be provisioned: