Author ARM Templates with Visual Studio

You will learn how to create and deploy virtual machines in Azure using the ARM templates including deploying custom images and Linux virtual machines.

  1. Open Visual Studio 2017/2019 and create a new project of the type Cloud – Azure Resource Group. Name the new project “Demo.AzureResourceTemplate” and save it to C:\Repo. Also, make sure that both check boxes are checked on the lower right, as in the screen shot below. When finished, click OK.

  2. On the next window, click Blank Template, and click OK.

  3. In the Solution Explorer window, open the azuredeploy.json file by double-clicking it.

  4. Then, probably on the left side of the Visual Studio window, open the window called JSON Outline. It will look like this screen shot.

  5. Save your Files

Add Azure SQL Database and server to the template

  1. Right-click on the resources item in the JSON Outline and click Add New Resource.

  2. Select SQL Server and give it a name like “demo”, then click Add.

  3. Now that the SQL Server has been created as a resource, right-click that SQL Server resource and choose Add New Resource so that you can add a database.

  4. Choose SQL Database, and call it “demodatabase.” Make sure that your server is selected in the drop-down list below, and click Add.

Last updated