Azure Resource Manager Templates
Azure Resource Manager Templates
Azure Resource Manager is the interface for managing and organizing cloud resources. Think of
Resource Manager as a way to deploy cloud resources.
A Resource Manager template precisely defines all the Resource Manager resources in a deployment.
You can deploy a Resource Manager template into a resource group as a single operation.
A Resource Manager template is a JSON file, making it a form of declarative automation. Declarative
automation means that you define what resources you need but not how to create them. Put another
way, you define what you need and it is Resource Manager's responsibility to ensure that resources are
deployed correctly.
Note: - You may hear others refer to Resource Manager Templates as "ARM templates". We prefer the
full names "Azure Resource Manager templates" or "Resource Manager Templates".
Using Resource Manager Templates will make your deployments faster and more repeatable. For
example, you no longer have to create a VM in the portal, wait for it to finish, then create the next VM,
and so on. Resource Manager takes care of the entire deployment for you.
A Resource Manager template can contain the following sections. These sections are expressed using
JSON notation, but are not related to the JSON language itself.
1. Parameters
2. Variables
3. Functions
4. Resources
5. Outputs
Parameters
This is where you specify which values are configurable when the template runs. For example, you might
allow users of your template to specify a username, password, or domain name.
Here's an example that illustrates two parameters – one for a VM's username and one for its password.
Variables
This is where you define values that are used throughout the template. Variables can help make your
templates easier to maintain. For example, you might define a storage account name one time as a
variable and use that variable throughout the template. If the storage account name changes, you need
to only update the variable.
Here's an example that illustrates a few variables that describe networking features for a VM.
Functions
This is where you define procedures that you don't want to repeat throughout the template. Like
variables, functions can help make your templates easier to maintain. Here's an example that creates a
function to create a unique name that could be used when creating resources that have globally unique
naming requirements.
Resources
This section is where you define the Azure resources that make up your deployment.
Outputs
This is where you define any information you'd like to receive when the template runs. For example, you
might want to receive your VM's IP address or FQDN – information you do not know until the
deployment runs.
Here's an example that illustrates an output named "hostname". The FQDN value is read from the VM's
public IP address settings.
Azure Quick start templates are Resource Manager templates that are provided by the Azure
community. Quick start templates are available on GitHub.
Many templates provide everything you need to deploy your solution. Others might serve as a starting
point for your template. Either way, you can study these templates to learn how to best author and
structure your own templates.