ARM Template Structure

💤0
Lv 10 XP
← 📜 Infrastructure as Code · ARM Templates

ARM Template Structure

Intermediate ⭐ 80 XP ⏱ 15 min #arm#azure#iac#json

Read and understand Azure Resource Manager templates — the JSON beneath Bicep.

📖Theory

ARM templates are the JSON that Azure Resource Manager actually deploys (Bicep compiles to this). Even if you write Bicep day-to-day, you’ll read ARM JSON in existing repos and the portal’s “export template” feature.

The standard sections:

  • parameters — inputs
  • variables — computed values
  • resources — what to deploy (the required part)
  • outputs — returned values
  • plus $schema and contentVersion

Deployments are idempotent, support modes (incremental vs complete), and can be validated with what-if before applying — just like Bicep.

🌍Real-World Example
{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "storageName": { "type": "string" }
  },
  "resources": [{
    "type": "Microsoft.Storage/storageAccounts",
    "apiVersion": "2023-01-01",
    "name": "[parameters('storageName')]",
    "location": "[resourceGroup().location]",
    "sku": { "name": "Standard_LRS" },
    "kind": "StorageV2"
  }]
}
✍️Hands-On Exercise
  1. Name the required section of an ARM template.
  2. Identify how a parameter is referenced inside a resource ([parameters('x')]).
  3. Explain the difference between incremental and complete deployment modes.
  4. Describe when you’d read ARM JSON rather than write Bicep.
🧾Cheat Sheet
SectionPurpose
$schemaTemplate schema version
parametersInputs
variablesComputed values
resourcesWhat to deploy (required)
outputsReturned values
Incremental modeAdd/update only (default)
Complete modeAlso delete unlisted resources
💬Common Interview Questions
What are the main sections of an ARM template?

$schema, contentVersion, parameters, variables, resources (required), and outputs. Resources declares what to deploy; the rest parameterize and return values.

What's the difference between incremental and complete mode?

Incremental adds or updates the listed resources and leaves others untouched. Complete also deletes any resources in the resource group not present in the template.

📚Official Documentation

📝 My notes on this topic

Auto-saves as you type