How to use Azure Resource Manager templates
· Category: Cloud Computing
Short answer
Azure Resource Manager (ARM) templates and Bicep provide declarative infrastructure deployment on Azure.
Steps
- Write a Bicep file (
main.bicep):
resource storage 'Microsoft.Storage/storageAccounts@2021-04-01' = {
name: 'mystorage'
location: resourceGroup().location
sku: { name: 'Standard_LRS' }
kind: 'StorageV2'
}
- Deploy:
az deployment group create --resource-group myRG --template-file main.bicep
Tips
- Bicep compiles to ARM JSON and is easier to read and write.
- Use modules for reusable components.
- Parameter files separate environment-specific values.
Common issues
- Template validation passes but deployment fails due to naming conflicts or quota limits.
- Understanding the Azure resource provider API versions is essential.