You deploy an ARM template that defines a virtual machine but forget to include the vmSize property. What will Azure Resource Manager do?
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"type": "Microsoft.Compute/virtualMachines",
"apiVersion": "2022-03-01",
"name": "myVM",
"location": "eastus",
"properties": {
"hardwareProfile": {
},
"storageProfile": {
"imageReference": {
"publisher": "MicrosoftWindowsServer",
"offer": "WindowsServer",
"sku": "2019-Datacenter",
"version": "latest"
}
},
"osProfile": {
"computerName": "myVM",
"adminUsername": "adminUser",
"adminPassword": "Password123!"
},
"networkProfile": {
"networkInterfaces": [
{
"id": "/subscriptions/xxx/resourceGroups/myRG/providers/Microsoft.Network/networkInterfaces/myNIC"
}
]
}
}
}
]
}Think about how ARM validates templates before creating resources.
ARM requires all mandatory properties to be present in the template. Missing required properties cause deployment validation errors, so the deployment fails before any resource is created.
You have an ARM template that creates a storage account and a virtual machine that uses that storage account. How does ARM ensure the VM is created only after the storage account is ready?
Consider how you tell ARM about resource order when one resource needs another.
ARM requires explicit dependency declarations using dependsOn to know the order of resource creation. Without it, ARM may deploy resources in parallel, causing failures if dependencies are not ready.
You need to deploy a database with a password using an ARM template. Which approach ensures the password is not exposed in the template or logs?
Think about how to keep secrets safe and not visible in templates or logs.
Using Azure Key Vault references allows ARM templates to securely retrieve secrets at deployment time without exposing them in the template or logs, following best security practices.
You run the following Azure CLI command to deploy an ARM template with the --what-if flag:
az deployment group create --resource-group myRG --template-file template.json --what-if
What will be the result?
What does the --what-if flag do in Azure CLI deployments?
The --what-if flag previews the changes ARM would make if the template were deployed, without actually applying any changes. This helps understand impact before deployment.
You manage a large Azure environment and want to organize your ARM templates for easier maintenance and reuse. Which approach follows best practices?
Think about how to keep templates manageable and reusable.
Using nested or linked templates with parameters allows modular design, easier maintenance, and reuse of ARM templates, which is a best practice for large environments.