Exam-Answer

Home / Microsoft / AZ-300 / Question 45

Prev Question
Next Question

Question 45

Your company is deploying new virtual machines (VMs) and associated resources using Azure Resource Manager templates. The company wants to use PowerShell cmdlets to provision the resources from a template deployed to your local computer.

You need to complete the PowerShell script to accomplish this.

How should you complete the PowerShell script? Select correct placeholder values.

PLACEHOLDER 1 PLACEHOLDER 2 RG02 -Location "North Central US"

PLACEHOLDER 3 PLACEHOLDER 4 RG02

-TemplateFile c:\\MyTemplates\\newazure.json

Answers


Advertisement

Explanation (click to expand)

You should complete the PowerShell script as follows:

New-AzResourceGroup -Name RG02 -Location "North Central US"

New-AzResourceGroupDeployment -ResourceGroupName RG02

-TemplateFile c:\\MyTemplates\\newazure.json

You need to first create the resource group and then deploy the resources from the template to the resource group.

You should use the New-AzResourceGroup cmdlet to create the resource group. You should use the -Name parameter to specify the resource group name and -Location to specify the regional location. The cmdlet does not support the -ResourceGroupName parameter.

After you create the resource group, you should use the New-AzResourceGroupDeployment cmdlet to deploy the resources. The -ResourceGroupName parameter is used to identify the resource group, and the -TemplateFile parameter is used to locate the template file to use. The -Name and -Location parameters are not supported by the cmdlet.

References (click to expand)

Prev Question
Next Question

Load more