What are Azure Resource Manager Templates?

An application’s infrastructure is usually made up of a number of components like virtual machines, virtual networks, web applications, database servers, storage accounts and some third party services. Even though these are different entities, we don’t see them as separate components. These are all different but related and usually interdependent parts of a single entity, that is your application. Since all of these are interdependent, it would make sense that you would want to deploy, manage and monitor them as a group. The ARM allows you to work with all these components of your application as a group and you can use it deploy, update and delete all the resources of your solution in a single operation.

Benefits and Features

  • The Azure Resource Manager allows you to use predefined structured templates for deployment.
  • These templates also work for different environments such as testing, staging and production.
  • ARM templates are all based on JSON syntax. This means that they are JSON files and hence follow the same syntax and structure as JSON.
  • ARM Templates define resources that you need to deploy on Azure. This means that depending on which template you choose, parameters like what the resource looks like, what configuration will it have and so on are all captured by Azure.
    • For example if you want to create a VM, you can simply use an Azure ARM Template to create an Azure VM. Then you can manipulate the configuration of the VM at a very granular level.
    • You can configure things like adding the VM to an availability set. Determine the location of the virtual machine. Whether the VM will use any extension. What storage account that VM will be using.
  • It also provides benefits like security, auditing and tagging features to help you manage your resources after the deployment has been made.
  • You can also interact with the Azure ARM from the Azure portal, REST API, PowerShell and Azure CLI.

When you deploy ARM Templates using Azure PowerShell or Azure CLI, you must create a resource group and then deploy the ARM Template.

Following are some key terms that you should be familiar with.

Resources: A resource is a key component of an Azure ARM Template and it is basically a manageable cloud item which is available through Azure. Things like Virtual Machines, Virtual Networks, Storage Accounts, Databases, etc are all Azure resources.

Resource Groups: A resource group is a type of container that hold related resources for an Azure solution and what goes into a resource group is entirely up to you. You can decide how to allocate resources to resource groups. For example there is an organization that has an HR, finance, technology and business domains. Supposing that all these departments use Azure, they need a way to distinguish between each and every vertical and their data. So to do this, the company assigns each vertical a resource group. Then, each vertical will deploy all their resources in the same Azure resource group. This makes it easy for the company owner to see the usage of Azure from each vertical and then act on it.

Resource Providers: A resource provider is a service that supplies deployable resources that you can manage using the resource manager. There are numerous different resource providers in the market and each have their own set of offerings and unique operations needed to work with various resources. Some of the common resource providers are Microsoft Compute which provides the VM resources, Microsoft Storage that provides the storage account resource and Microsoft Web that provides resources related to web apps.

ARM Templates: It is a JSON file that defines one or more resources to deploy to a resource group. It also defines the dependencies between the deployed resources. You can use the template to deploy resources consistently and repeatedly. You will need to use declarative syntax that makes everything easier. You can use declarative syntax to state what you want to do and avoid the hassle of having to write the code to create it. Azure ARM Templates are a great example of the declarative syntax where you simply use the template to define the properties of the infrastructure to deploy to Azure.