AZ-104 Question 126
Single answerYou are an Azure Administrator for a company that has multiple environments (development, testing, and production) for a web application. You have a Bicep file that declares and configures the required Azure resources. You want to ensure that environment-specific settings can be applied without modifying the main Bicep file. Which approach should you prioritize?
- A
Place environment-based values in inline variables within the Bicep file
- B
Use separate parameter files and link them during deployment
- C
Rely on environment-specific conditional statements inside the same Bicep file
- D
Manually apply environment differences by editing the Bicep file before each deployment
Show answer and explanation
Correct answer: B
Explanation
By referencing separate parameter files, you can keep the main Bicep file reusable across environments while applying environment-specific settings in parameter files. This approach is more maintainable, reduces errors, and aligns well with best practices for ARM Template/Bicep deployments.
- A. Incorrect.
Embedding environment-specific values directly in the Bicep file can lead to confusion and requires changes to the core file whenever an environment setting updates
- B. Correct.
Using parameter files for each environment helps maintain a single Bicep file and simplifies deployments across different environments
- C. Incorrect.
Including large conditional logic within a single Bicep file can become difficult to manage and obscure the deployment strategy for different environments
- D. Incorrect.
Manually editing the Bicep file introduces the risk of human error and makes it harder to maintain consistency across multiple environments