Question 53 — AZ-104 Case Study Set
Review the ARM template fragment used by Paideffort.
{
"parameters": {
"vmName": {
"type": "string"
},
"vmSize": {
"type": "string",
"defaultValue": "Standard_D2s_v5"
},
"virtualNetworkName": {
"type": "string"
}
},
"resources": [
{
"type": "Microsoft.Compute/virtualMachines",
"apiVersion": "2024-07-01",
"name": "[parameters('vmName')]",
"location": "[resourceGroup().location]",
"properties": {
"hardwareProfile": {
"vmSize": "Standard_D4s_v5"
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]"
}
]
}
}
}
]
}
Which two changes are necessary to align the template with Paideffort's environment-specific VM requirements? (Select two answers)
Replace the hardcoded
Standard_D4s_v5value with a reference to thevmSizeparameter.Define the referenced
nicNameparameter so each environment can supply the required network-interface name.Remove the
vmSizeparameter because VM sizes cannot be parameterized in ARM templates.Replace
resourceId()with a hardcoded network-interface resource ID shared by staging and production.
Correct answers
Replace the hardcoded
Standard_D4s_v5value with a reference to thevmSizeparameter.Define the referenced
nicNameparameter so each environment can supply the required network-interface name.
Explanations
Correct Answer:
Replace the hardcoded Standard_D4s_v5 value with a reference to the vmSize parameter.
Define the referenced nicName parameter so each environment can supply the required network-interface name.
Explanation:
Paideffort expects staging to use the default Standard_D2s_v5 size while allowing production to select another supported value. The resource currently ignores vmSize because its hardware profile is hardcoded. The template also references nicName even though no such parameter is defined. Correcting both issues enables the intended reusable environment-specific deployment.
Wrong Answers:
Remove the vmSize parameter because VM sizes cannot be parameterized in ARM templates.
VM configuration values can be parameterized. Paideffort specifically needs a VM size that changes between staging and production.
Replace resourceId() with a hardcoded network-interface resource ID shared by staging and production.
Paideffort requires environment-specific networking. Hardcoding one NIC resource ID would reduce reusability and could incorrectly bind multiple environments to the same resource.