AZ-104 Question 118
Select 2You have updated an existing Azure Resource Manager (ARM) template to include a new parameter named 'vmCount' that accepts integer values between 1 and 5. However, deployments are failing because the new parameter is not recognized within the resource definitions. Which of the following steps must you take to resolve this issue and ensure a successful deployment?
- A
Include 'vmCount' in the variables section of the template
- B
Reference 'vmCount' in the resource definitions using the correct parameter syntax
- C
Supply a value for 'vmCount' during deployment using a parameters file or inline parameters
- D
Update the template schema version to the latest supported version
Show answer and explanation
Correct answers: B, C
Explanation
To successfully deploy the updated ARM template, you must properly reference the new parameter within the resource definitions and pass a value for that parameter during deployment. Without both steps, correct parameter usage in the template and supplying the parameter value, Azure will report an unrecognized parameter error.
- A. Incorrect.
Declaring the parameter in variables is unnecessary; 'vmCount' is already defined as a parameter and does not need to be duplicated in variables.
- B. Correct.
You must reference 'vmCount' within the resources section (e.g., [parameters('vmCount')]) for it to be recognized by the deployment process.
- C. Correct.
If the template parameter does not have a default value or requires customization, you must supply the parameter value via a parameters file or inline to avoid deployment failures.
- D. Incorrect.
While keeping the schema version up to date is recommended, it does not resolve parameter recognition issues and is not required in this scenario.