Exam-Answer

== Trim, Convert and Download YouTube videos at cutyt.com. Free! ==

Home / Microsoft / AZ-100 / Question 65

Prev Question
Next Question

Question 65

You have an ARM template for creating a Windows virtual machine. You got this template from an existing resource group with a single virtual machine, using the automation script option.

You want to reuse this template for other deployments. You need all the resources in the resource group to be on the same location.

What should you do?

Answers



A B C D

Advertisement

Explanation

You should edit the template file and update each location parameter with the value [resourceGroup().location]. The resourceGroup() function gets the resource group object that will be used for deploying the template. This way, all resources in the template will use the same location as the resource group. You need to ensure that all resources are supported in the location that you are using for the resource group.

You should not edit the parameters file and add a new parameter named location of type string with the default value of [resourceGroup().location]. This is the first step for centralizing the location value in the template, but you also need to update the location parameter in the template file with the value [parameters('location')].

You should not use the Azure portal and create a resource group in the desired location and then use the New-AzureRmResourceGroupDeployment cmdlet using the newly created resource group. If the resource group is deployed in a location different than the configured in the template file, the resources will be deployed in different locations. You need to modify the location parameter in the template file to the value [resourceGroup().location] to inherit the location from the parent resource group.

You should not use the New-AzureRmResourceGroup cmdlet with the location parameter to create a resource group in the desired location and then use the New-AzureRmResourceGroupDeployment cmdlet using the newly created resource group. If the resource group is deployed in a location different than the configured in the template file, the resources will be deployed in different locations. You need to modify the location parameter in the template file to the value [resourceGroup().location] to inherit the location from the parent resource group.

References

Comments

Load more
Prev Question
Next Question


== Trim, Convert and Download YouTube videos at cutyt.com. Free! ==