Most of us use our beloved Azure Management Portal to create all our Azure App Services. Every time you create any Azure service, you need to do the following different steps to create the resources manually. Below are a few of the disadvantages of using the Azure Management Portal to create the Azure resources.

The solution for all of the above disadvantages is to automate the process of creating the Azure resources using ARM templates.

For more information about ARM templates, please have a look here.

Let’s make this discussion very simple and precise by creating and deploying the ARM template using Visual Studio.

As we are using built in templates, we don’t need to do anything else. That’s it. Let’s now deploy the Infrastructure that we defined using the JSON files.

Right click the project, select “Deploy -> “New Deployment” as shown below.

New Deployment

Clicking on the “New Deployment” button in the previous step will open up the following window where you need to provide few details that are required to create and deploy the App Service in Azure.

deploying

You need to sign-in using your Azure Subscription credentials.

We will discuss more about the Template JSON file and the Template Parameters file in our coming articles.

After providing all the details, click on “Deploy” button. It will prompt you to provide the hosting App Service Plan name as the default value in the Parameters file is null. We will learn, how to pass it in the .JSON file in our future articles. For now, I gave “Free” in the “hostingPlanName” and selected “F1” in the “skuName”

save

Now, click “Save” button. Visual Studio will launch the PowerShell console and run couple of PowerShell commands in the background for executing the Infrastructure code that we created using the default templates available in the Visual Studio.

Below is the screen capture of the Output window from my Visual Studio.

Output

That’s it. Our App Service along with the App Service Plan is created in Azure for the selected subscription. For reference, the screenshot is shown below:

output