Resource Groups and Template Scope
What you'll learn: How ARM templates target resource groups and how deployment scopes determine where your resources land.
Understanding Deployment Scope
When you deploy an ARM template, you must specify a scope — essentially telling Azure where to deploy your resources. The scope determines what level of the Azure hierarchy your template targets.
At this stage in your learning, the most common scope is the resource group scope. Think of it like addressing a letter: you need to tell Azure which "neighborhood" (resource group) should receive the resources you're declaring in your template.
Resource Groups as Deployment Targets
A resource group is a logical container that holds related Azure resources. When you deploy an ARM template at resource group scope:
- All resources declared in the template are created within that resource group
- The deployment operation itself is tracked in that resource group's deployment history
- You must specify which resource group during deployment (via Portal, CLI, or PowerShell)
Analogy: A resource group is like a folder on your computer. When you run an ARM template deployment, you're telling Azure "put everything this template creates into this folder."
Template Structure and Scope
Your template's structure doesn't change based on scope — the same parameters, variables, resources, and outputs sections apply. What changes is the deployment command and which resource group you target.
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [ ... ]
}
The schema URL indicates resource group scope by default.
Key Takeaway: ARM templates deploy to a specific resource group scope, meaning all resources land in the target resource group you specify at deployment time — the template itself is scope-agnostic until you deploy it.