Skip to main content
Azure Resource Manager (ARM) templates are the declarative, Infrastructure-as-Code (IaC) way to describe and deploy Azure resources. ARM templates are JSON files that declare the resources you want—without specifying the procedural steps Azure must take to create them. This is the core of declarative automation. Think of an ARM template like HTML: you describe the structure and the renderer (browser or Azure Resource Manager) takes care of constructing and presenting the result.

Key benefits

  • Consistent and reusable: Templates produce predictable environments. Using parameters avoids hard-coded values and makes templates reusable across environments.
  • Single-operation deployment: Deploy a complete set of resources in one action, reducing human error versus manual creation.
  • Modular and scalable: Break complex deployments into smaller templates that are linked or nested so dependencies and deployment order are managed automatically.
A minimal ARM template skeleton:

Template design approaches

Choose an approach based on the size and lifecycle of your deployment:
  • Single template: All resources in one ARM template — simple for small deployments (one or two resources).
  • Nested/linked templates: A main template references smaller templates (for VMs, App Services, SQL, etc.). Use this for complex environments to separate concerns and enable reuse.
  • Separate templates per resource group: Maintain independent templates for resources grouped into different resource groups and deploy them separately.
When to use each approach: Consider a three-tier application: front-end App Service (or VM), middle-tier App Service, and back-end SQL Database. Options include:
  • Deploy all three tiers from a single template and reference the SQL Database from the App Service configuration.
  • Use a main template to create the resource group and kick off nested templates for each tier.
  • Deploy each tier with separate templates to different resource groups for isolation.
A diagram titled "ARM Template Design" showing an Azure deployment flow: a main template calling nested VM, App Service, and SQL templates which provision a Virtual Machine, App Service, and SQL Database inside a resource group.
If your deployment contains many resources or repeated patterns, prefer the linked/nested approach to improve maintainability. For small deployments, a single template is usually simpler and faster to manage.

ARM template structure — field explanations

Below is the same skeleton followed by concise descriptions of the top-level elements you will use most often:
  • $schema: Location of the JSON schema that validates the template structure. Enables tooling, schema validation, and IntelliSense.
  • contentVersion: A version string for your template for tracking changes (not interpreted by Azure).
  • parameters: Values supplied at deployment time to customize behavior (for example, VM size, admin username, or location). Use parameters to make templates flexible and reusable.
  • functions: Optional user-defined functions to reuse expressions across the template.
  • variables: Computed values or aliases derived from parameters/constants to simplify resource definitions.
  • resources: An array of resource objects that the template will deploy. Each resource typically includes type, apiVersion, name, properties, and optional dependencies (dependsOn).
  • outputs: Values returned after deployment completes, such as connection strings, endpoints, or resource IDs.
Quick reference table for the top-level elements:

Authoring tools

For authoring and validating ARM templates, the Azure Resource Manager (ARM) Tools extension for Visual Studio Code greatly improves developer productivity by offering snippets, schema validation, and IntelliSense.
A screenshot of Visual Studio Code's Extensions panel showing the "Azure Resource Manager (ARM) Tools" extension details. The left sidebar lists other installed extensions and the slide header reads "ARM Extensions for VS Code (optional)."
This extension is optional and not required, but it helps with writing and validating ARM templates.
When deploying templates, ensure the identity used for the deployment has the required RBAC permissions for the resources being created. Misconfigured permissions can cause deployments to fail or to be only partially applied.

Watch Video