AZ-104 exam dumps

AZ-104 practice question 125 of 289

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

AZ-104 Question 125

Single answer

You have created a Bicep file to deploy an Azure Virtual Network for different environments. The Bicep file includes a parameter named 'vnetPrefix' which defaults to '10.0.0.0/16'. You need to temporarily override this value to '192.168.0.0/24' for a test environment deployment using the Azure CLI without permanently changing the default. Which method should you use?

  1. A

    Modify the default value for 'vnetPrefix' permanently in the Bicep file to '192.168.0.0/24'

  2. B

    Supply the parameter override in the Azure CLI command using --parameters vnetPrefix=192.168.0.0/24

  3. C

    Replace the default parameter value by editing the generated JSON template before deploying

  4. D

    Provide a template link with the new address prefix in the Bicep file’s main parameters section

Show answer and explanation

Correct answer: B

Explanation

By supplying --parameters vnetPrefix=192.168.0.0/24 in the Azure CLI, you can override the default value only for that specific deployment. This avoids permanent changes to the Bicep file and aligns with best practices for flexible parameter management.

  • A. Incorrect.

    Changing the default permanently in the Bicep file forces all environments to use the new prefix and does not allow flexible overrides for different environments.

  • B. Correct.

    Using --parameters in the Azure CLI command allows you to override parameters for a specific deployment without altering the default value in the Bicep file.

  • C. Incorrect.

    Editing the JSON template directly each time is error-prone and not a recommended best practice for parameter overrides.

  • D. Incorrect.

    Linking a new prefix in the Bicep file’s main parameters section still requires changing the Bicep file, rather than the deployment command.

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