AZ-104 exam dumps

AZ-104 practice question 122 of 289

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

AZ-104 Question 122

Single answer

You have an existing Bicep file that declares a storage account resource with a hardcoded name. You want to modify the file so that the storage account name can be provided during deployment. Which modification should you implement?

  1. A

    Add a param statement for the storage account name and reference it in the resource’s name property

  2. B

    Replace the existing resource definition with a module declaration that references a hardcoded name

  3. C

    Use an output statement instead of a param to allow name changes at deployment time

  4. D

    Rename the resource’s name property to storageName but continue to hardcode the value

Show answer and explanation

Correct answer: A

Explanation

The best way to allow a customizable resource name in a Bicep file is to declare a param, then reference that param in the resource definition. This ensures the name can be provided during deployment rather than remaining fixed.

  • A. Correct.

    By introducing a param for the storage account name (e.g., param storageAccountName string) and then using that param in name: storageAccountName, you allow the name to be dynamically supplied during deployment

  • B. Incorrect.

    Replacing the entire resource definition with a module referencing a fixed name doesn’t enable a new parameter; it simply restructures the code

  • C. Incorrect.

    Using an output statement will not allow name changes; outputs only capture and expose values after deployment, not receive them as inputs

  • D. Incorrect.

    Renaming the property without making it param-based still hardcodes the value, so it doesn’t allow for a dynamic name

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