nerdexam
Microsoft

AZ-104 · Question #178

Hotspot Question You have an Azure subscription. You need to use an Azure Resource Manager (ARM) template to create a virtual machine that will have multiple data disks. How should you complete the…

The correct answer is Property for data disks definition: "copy":[; Value for lun property: "[copy". To create multiple data disks for a virtual machine using an ARM template, use the 'copy' loop construct for the data disks array and assign a unique Logical Unit Number (LUN) to each disk using the 'copyIndex' function.

Submitted by yousef_jo· Mar 4, 2026Deploy and manage Azure compute resources

Question

Hotspot Question You have an Azure subscription. You need to use an Azure Resource Manager (ARM) template to create a virtual machine that will have multiple data disks. How should you complete the template? To answer, select the appropriate options in the answer area. NOTE: Each correct selection is worth one point. Answer:

Exhibit

AZ-104 question #178 exhibit

Answer Area

  • Property for data disks definition"copy":[
    "copy":["copyIndex":["dependsOn":[
  • Value for lun property"[copy"
    "[copy""[copyIndex""[dependsOn"

Explanation

To create multiple data disks for a virtual machine using an ARM template, use the 'copy' loop construct for the data disks array and assign a unique Logical Unit Number (LUN) to each disk using the 'copyIndex' function.

Approach. 1. First Hotspot (Top Dropdown): The question requires creating multiple data disks based on the numberOfDataDisks parameter. The JSON structure following the first dropdown ({ "name": "dataDisks", "count": "parameters('numberOfDataDisks')", "input": {...} }) is the standard syntax for defining a 'copy' loop in an ARM template to create multiple instances of a resource or property. Therefore, the appropriate selection for this dropdown is copy. This tells the ARM template engine to create an array of data disks by iterating numberOfDataDisks times, using the definition provided in the input block. 2. Second Hotspot (Bottom Dropdown): The lun (Logical Unit Number) property for each data disk must be unique within a virtual machine. When creating multiple data disks using a 'copy' loop, the copyIndex() function is used to get the current iteration number, which starts at 0 by default. This provides a unique, sequential number for each disk's LUN (0, 1, 2, ...). Therefore, the appropriate selection for this dropdown is copyIndex to assign the loop index as the LUN.

Common mistakes.

  • common_mistake. 1. Choosing 'copyIndex' for the first hotspot: copyIndex is a function used within a copy loop to get the current iteration, not to define the loop itself. The overall structure for defining a copy loop for an array is "copy": [ { "name": ..., "count": ..., "input": {...} } ]. Choosing 'copyIndex' here would result in an incorrect template structure.
  1. Choosing 'dependsOn' for either hotspot: dependsOn is used to specify dependencies between resources, ensuring resources are deployed in the correct order. It has no role in dynamically generating multiple instances of a property or assigning unique numerical identifiers like LUNs.
  2. Choosing 'copy' for the second hotspot: copy defines a loop structure. The lun property expects an integer value, not another loop definition. Placing 'copy' here would be syntactically incorrect and would not assign a unique LUN.

Concept tested. The core concept tested is the ability to use Azure Resource Manager (ARM) template 'copy' loops and the copyIndex() function to dynamically create multiple instances of a resource property (in this case, multiple data disks) and assign unique identifiers (LUNs) to them during deployment.

Reference. https://docs.microsoft.com/azure/azure-resource-manager/templates/copy-loops

Topics

#ARM templates#Azure VMs#VM data disks

Community Discussion

No community discussion yet for this question.

Full AZ-104 Practice