A Beginners Guide to Arm Templates

So you’ve taken the dive and are now looking into how to automate creating things within azure. Awesome! welcome to the blog. I am going to go over a few things that you will need to start and then jump right into creating an arm template.

You will need some items to get started with creating and deploying arm templates.

  • An Azure Subscription (get one here)
  • A Visual Studio Online Account (get one here)
  • Visual Studio Community Edition or higher ( Free by the way 😉 )

What is an ARM template?
A little while ago Microsoft came up with ARM (Azure Resource Manager). It allows you to control the portal in which you have an azure subscription for, through the use of JSON, and powershell. ARM templates are basically packages of JSON and powershell that are used to programmatically deploy resources within Azure.

How can i get started creating an ARM template already?
This section is going to assume you’ve already downloaded visual studio community edition, and have a source control repository created in your visual studio online account.

You will first want to create a new project, choose any language you’d like. I personally use C#, inside that section you will see a subsection called Cloud, and then finally Azure Resource Group. While working with Azure ARM Templates you will be placing your resources within resource groups. Create your project and let’s get started.

Alright you should now have your project created. You’ll see a few different files within your solution explorer. 

  • azuredeploy.json
  • azuredeploy.paramters.json
  • azuredeploy-azureresourcegroup.ps1

These files all have different roles to play. azuredeploy.json is what you will be using the most, it describes parameters that will need to be passed to the deployment, variables that you will create for use within the file, resources that you will create, and outputs should you want to output anything after resources are created.

azuredeploy.parameters.json, this file is used to pass parameters into your azuredeploy.json file. You can have many parameters files for different environments so that you can create different environments quickly. 

azuredeploy-azureresourcegroup.ps1 is the file that ties both your azuredeploy.json, and azuredeploy.parameters.json files together, it is what will be deploying your resources when you say go!

Each File Type in Detail