Resource Declarations in ARM Templates
You'll learn: How to define Azure resources in ARM templates using the required JSON fields that tell Azure exactly what to create.
What Is a Resource Declaration?
A resource declaration is the JSON object that describes an Azure resource you want to deploy—like a virtual machine, storage account, or database. Think of it as filling out a standardized order form: Azure needs specific information in specific fields to create what you want.
The Five Essential Fields
Every resource declaration requires these fields:
type — Identifies what you're creating (e.g., Microsoft.Storage/storageAccounts, Microsoft.Compute/virtualMachines). This is like selecting a product category.
apiVersion — Specifies the API version Azure should use. Each resource type evolves over time, and this locks in which feature set you're using (e.g., 2023-01-01).
name — The unique identifier for your resource within its scope. Must follow Azure naming rules for that resource type.
location — The Azure region where the resource deploys (e.g., eastus, westeurope). Some resources are global and don't need this.
properties — The configuration details specific to your resource type. A storage account needs SKU and kind; a VM needs size and OS settings. This object varies dramatically by resource type.
Why These Fields Matter
Azure's Resource Manager uses type and apiVersion to understand how to process your request, name and location to know where to create it, and properties to configure what it should look like. Missing any required field causes deployment to fail immediately.
Key Takeaway: Every ARM template resource requires type, apiVersion, name, location (usually), and properties—these five fields form the minimum contract between you and Azure to create infrastructure.