QuestionQ106

VerifiedDeploy and manage Azure compute resources

You have an Azure subscription.

You create the following file named Deploy.json.

Question Image

You connect to the subscription and run the following commands.

Question Image

For each of the following statements, select Yes if the statement is true. Otherwise, select No.

Yes or No
StatementsYesNo
The commands will create four new resources.
The commands will create storage accounts in the West US Azure region.
The storage account created by the first iteration of the copy loop will have a name that starts with 0.
Explanation

The two commands create four new resources. New-AzResourceGroup creates RG1 in centralus, and Microsoft's Resource Manager terminology states that resource groups, subscriptions, management groups, and tags are also resources. New-AzResourceGroupDeployment then deploys Deploy.json, whose copy loop (count 3) creates three storage accounts, so the total is 1 + 3 = 4. The storage accounts are created in centralus because their location is set to [resourceGroup().location]; the location parameter (default westus) is declared but never referenced, so nothing is created in West US. copyIndex() is zero-based, so the first iteration of the loop produces a name that starts with 0 (0storage..., then 1storage... and 2storage...). Copy-loop iterations deploy in parallel by default and their creation order isn't guaranteed, which is why the statement refers to the first iteration rather than to the first account created.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!