ARM templates
What it is
An ARM template is a JSON file that declaratively describes the resources you want to deploy to Azure and their relationships, in a logical object model. Azure Resource Manager reads it and provisions the resources idempotently — it diffs against the current state and applies only the changes needed to reach the declared goal.
Why it exists
Clicking through the Portal or imperative CLI is fine for one resource but not reproducible or auditable for a fleet. Templates make infrastructure code: versioned in git, reviewed, reused with parameters, and safely re-run (no surprise re-provisions).
Key ideas
- Idempotent / declarative: re-deploying the same template brings resources to the declared state — unchanged ones are left alone.
- Structure (top-level elements):
$schema,contentVersion,parameters,variables,functions,resources, andoutputs. - Scope: resource-group, subscription, management group, or tenant deployment.
- You can deploy incrementally (default) or complete; type parameters make templates reusable.
- Bicep is a modern DSL that compiles down to these JSON templates (same engine). Could use
ConvertTo-Json/portal “Export template” to get a starting point. - Deploy via Portal, Azure CLI (
az deployment), PowerShell, or Azure DevOps/GitHub Actions.
How it fits (diagram)
Exam notes
- ARM template vs MPI (managed identity): not related — templates are IaC.
- Incremental vs complete deployment modes: incremental only adds/changes listed resources; complete deletes resources in the RG not in the template (dangerous — default is incremental).
- Linked/nested templates with
deploymentsresource for modularity. - Exam: recognize template JSON anatomy and that it’s declarative + idempotent.
Related
Path MOC · bicep · azure-cli · azure-vm
📘 Source: Microsoft Learn — Arm Template