AZ-104 exam dumps

AZ-104 practice question 124 of 289

Microsoft Certified: Azure Administrator Associate. Associate level, Microsoft. Free question with the correct answer and a full explanation.

AZ-104 Question 124

Select 2

You are an Azure Administrator for Contoso. The company relies on Infrastructure as Code for all new resource deployments. They recently built a Bicep file to deploy an Azure SQL Database, and the team wants to ensure the resource name is not hard-coded so it can differ between environments. Which two actions should you recommend?

  1. A

    Convert the database name to a parameter in the Bicep file, then pass the value at deployment time.

  2. B

    Hard-code the database name in the Bicep file to maintain consistency across all environments.

  3. C

    Use a parameter file and reference it in the deployment command to supply environment-specific values.

  4. D

    Maintain separate Bicep files for each environment and define the resource name in each file.

Show answer and explanation

Correct answers: A, C

Explanation

Parameters in Bicep and separate parameter files provide a clean, reusable solution for environment-specific resource names. Optionally, you can combine both approaches: parametrize the resource name in the Bicep file and pass the corresponding values via a parameter file.

  • A. Correct.

    Defining the database name as a parameter in Bicep and providing it at deployment time is a recommended way to allow flexibility and reuse of the same file across different environments.

  • B. Incorrect.

    Hard-coding the database name removes flexibility, defeating the purpose of dynamic environment deployments.

  • C. Correct.

    Using a parameter file is a best practice to separate environment-specific configurations from the template, ensuring a single template can be reused with different parameter files.

  • D. Incorrect.

    Creating multiple Bicep files for each environment increases complexity and maintenance overhead, making it harder to manage common resource definitions.

Timed practice exam

Take a AZ-104 practice test under exam conditions

60 questions in 60 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam