You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
ARM templates are JSON files that define Azure resources declaratively. In this lesson, you will learn the anatomy of an ARM template, understand each section, and write your first complete template.
Every ARM template has the following top-level structure:
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"variables": {},
"functions": [],
"resources": [],
"outputs": {}
}
| Section | Required | Description |
|---|---|---|
| $schema | Yes | URL of the JSON schema that validates the template |
| contentVersion | Yes | Version of your template (e.g., "1.0.0.0") |
| parameters | No | Input values provided at deployment time |
| variables | No | Computed values used within the template |
| functions | No | User-defined functions for reusable logic |
| resources | Yes | The Azure resources to deploy |
| outputs | No | Values returned after deployment |
The schema URL tells ARM which template format to use. The most common schemas are:
| Schema | Scope |
|---|---|
2019-04-01/deploymentTemplate.json# | Resource group deployments |
2019-08-01/managementGroupDeploymentTemplate.json# | Management group deployments |
2018-05-01/subscriptionDeploymentTemplate.json# | Subscription deployments |
2019-08-01/tenantDeploymentTemplate.json# | Tenant deployments |
The resources array is the heart of every template. Each resource object has these properties:
{
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2023-01-01",
"name": "myuniquestorage2024",
"location": "[resourceGroup().location]",
"sku": {
"name": "Standard_LRS"
},
"kind": "StorageV2",
"properties": {}
}
| Property | Description |
|---|---|
| type | The resource provider and type (e.g., Microsoft.Storage/storageAccounts) |
| apiVersion | The REST API version to use |
| name | The resource name (must be unique where required) |
| location | The Azure region |
| sku | The pricing tier or size |
| kind | The resource subtype (varies by resource) |
| properties | Resource-specific configuration |
Here is a complete ARM template that deploys a storage account and a blob container:
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.