What are ARM Templates?
Azure Resource Manager (ARM) Templates are JSON files that define Azure resources declaratively.
Instead of manually creating resources in the portal, you describe what you want, and Azure provisions it consistently.
Key Concepts
-
Declarative syntax: Describe the final state; Azure figures out how to get there.
-
Idempotent: Running the same template multiple times gives the same result.
-
Repeatable: Use the same template to deploy identical environments (e.g., dev, test, prod).
ARM Template Structure
-
Schema – version of the template.
-
Parameters – input values (e.g., VM size, location).
-
Variables – reusable values inside the template.
-
Resources – actual Azure resources to deploy (VMs, storage, networks, etc.).
-
Outputs – values returned after deployment (e.g., public IP address).
Example (Simplified VM Template)
Benefits of ARM Templates
-
Ensure consistency across environments.
-
Support automation via Azure DevOps or GitHub Actions.
-
Can be modular using linked templates or Bicep (simplified ARM).
-
Work with Azure Policy to enforce governance during deployment.
Confusion Buster 🚨
-
ARM Template vs Bicep
-
ARM = JSON, verbose.
-
Bicep = higher-level DSL that compiles into ARM.
-
-
ARM Template vs CLI Script
-
Template = declarative (“what”).
-
Script = imperative (“how”).
-
Exam trap: If the question says “repeatable, idempotent infrastructure deployment”, the answer is ARM Templates, not CLI scripts.
Simple Example
A company:
-
Uses an ARM Template to deploy a 3-tier app (VNet + VMs + Load Balancer).
-
Developers pass parameters for region and VM size.
-
The same template deploys Dev, Test, and Prod environments with no manual errors.
Exam Tip
-
“Infrastructure as Code in Azure” → ARM Templates.
-
“Reuse template with different inputs” → Parameters.
-
“Return public IP after deployment” → Outputs.
-
“Run same deployment multiple times without duplication” → Idempotency.
What to Expect in the Exam
-
Direct Q: “Which Azure feature allows declarative, idempotent deployments?” → ARM Templates.
-
Scenario: “Company wants to enforce consistent resource deployment across regions.” → ARM Templates.
-
Trick Q: “ARM Templates must be written in PowerShell.” (False — they’re JSON, though deployable via CLI/PowerShell).