Step by Step ARM Templates - What is in an ARM Template - Understanding All Components

@20aman    Aug 22, 2016

Index of all blogs in this Step by Step ARM Templates series is located here: Step by Step Azure Resource Manager (ARM) Templates - Index

As we discussed earlier in the introduction Azure Resource Manager (ARM) Template is a JavaScript Object Notation (JSON) file that defines one or more resources to deploy to a resource group. It also defines the dependencies between the deployed resources.

In this post, we will deconstruct any basic ARM template and will understand it's various components.

Any ARM Template will look like below:

{
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {},
    "variables": {},
    "resources": [ {}, {} ]
}

Snapshot of the Template at root level, as generated via Visual Studio:

ARM Template Components

As you can see the components (or properties) of any ARM template includes:

  1. Schema
  2. Content Version
  3. Parameters
  4. Variables
  5. Resources

Let's look at these in more detail.

Element name Required JSON Type Description
$schema Yes String Value Location of the JSON schema file that describes the version of the template language.
contentVersion Yes String Value Version of the template (such as 1.2.0.20). When deploying resources using the template, this value can be used to make sure that the right template is being used.
parameters No JSON Object Values that are provided by the end user (manually or via a parameters file) when deployment is executed to customize resource deployment.
variables No JSON Object Values that are reused multiple times in the template. You can update these values. They are different from Parameters as their value is known and they are not required as inputs from the end user.
resources Yes Array of Objects Types of services that are deployed or updated in a resource group. Each JSON object in this Array denotes an Azure Resource.
outputs No JSON Object Values that are returned after deployment.

Now that you know what each part is at a high level, in the next posts, we will look at the key 4 components in detail.

  1. Parameters
  2. Variables
  3. Resources
  4. Outputs





Comments powered by Disqus