Question 23 of 179 from exam AZ-204: Developing Solutions for Microsoft Azure

Question 23 of 179 from exam AZ-204: Developing Solutions for Microsoft Azure

Question

HOTSPOT - You are configuring a new development environment for a Java application.

The environment requires a Virtual Machine Scale Set (VMSS), several storage accounts, and networking components.

The VMSS must not be created until the storage accounts have been successfully created and an associated load balancer and virtual network is configured.

How should you complete the Azure Resource Manager template? To answer, select the appropriate options in the answer area.

NOTE: Each correct selection is worth one point.

Hot Area:

Answer Area
{

“resources”: [

{
“apiVersion": "2016-01-01",
"type": “Microsoft. Storage/storageAccounts",
"name": “[concat( LQ, ‘storage’, uniqueString(resourceGroup().id))]",
copy
copyindex

priority
dependsOn

"[resourceGroup().location]",

"name": "Standard_LRS"
ys
“kind storage",
"properties": {},
s mee
copy
copylndex
priority
dependsOn

“name'
‘count

toragesetup",

3

“apiVersion”: "2015-06-15",
licrosoft .Compute/virtualMachines",
[concat(‘VM', uniqueString(resourceGroup().id))]",

[

copy
copylndex
priority
dependsOn

“[variables(‘loadBalancerName’)]",
[variables(‘virtualNetworkName")]",

“storagesetup",
1

Explanations

Answer Area
{

“resources”: [
{
“apiVersion": "2016-01-01",
“type”: “Microsoft .Storage/storageAccounts",
"name": “[concat( LQ, ‘storage’, uniqueString(resourceGroup().id))]",
copy
‘copyindex |

priority
dependsOn

"[resourceGroup().location]",

"name": "Standard_LRS"

ys

“kind storage",

"properties": {},

s mee
|copy |
copylndex
priority
dependsOn

“name'
‘count

toragesetup",

3

“apiVersion”: "2015-06-15",
licrosoft .Compute/virtualMachines",
[concat(‘VM', uniqueString(resourceGroup().id))]",

[

copy
copylndex
priority
‘dependsOn

“[variables(‘loadBalancerName’)]",
[variables(‘virtualNetworkName")]",

“storagesetup",
1

Box 1: copyIndex - Notice that the name of each resource includes the copyIndex() function, which returns the current iteration in the loop.

copyIndex() is zero-based.

Box 2: copy - By adding the copy element to the resources section of your template, you can dynamically set the number of resources to deploy.

Box 3: dependsOn - Example: "type": "Microsoft.Compute/virtualMachineScaleSets", "apiVersion": "2020-06-01", "name": "[variables('namingInfix')]", "location": "[parameters('location')]", "sku": { "name": "[parameters('vmSku')]", "tier": "Standard", "capacity": "[parameters('instanceCount')]" }, "dependsOn": [ "[resourceId('Microsoft.Network/loadBalancers', variables('loadBalancerName'))]", "[resourceId('Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]" ], Reference: https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/copy-resources https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/quick-create-template-windows.