Exam AZ-104 All QuestionsBrowse all questions from this exam
Question 308

You develop the following Azure Resource Manager (ARM) template to create a resource group and deploy an Azure Storage account to the resource group.

Which cmdlet should you run to deploy the template?

    Correct Answer: D

    The ARM template provided defines a deployment that creates a resource group and then deploys a storage account within that resource group. This operation requires deployment at the subscription level because the resource group itself is being created. The appropriate cmdlet for deploying resources at a subscription level is New-AzDeployment, which handles deployments that include the creation of resource groups and any resources within them. Therefore, New-AzDeployment is the correct cmdlet to use for this task.

Discussion
Tinkers69Option: D

D is correct here. We are creating RG and storage acc. in this RG. By using New-AzResourceGroupDeployment command -> "Adds an Azure deployment to a resource group."

Tarni

Agree Answer should be D 1. The New-AzDeployment cmdlet adds a deployment at the current subscription scope. This includes the resources that the deployment requires. https://learn.microsoft.com/en-us/powershell/module/az.resources/new-azdeployment?view=azps-8.3.0

skydivex

agreed..... To add resources to a resource group, use the New-AzResourceGroupDeployment which creates a deployment at a resource group. The New-AzDeployment cmdlet creates a deployment at the current subscription scope, which deploys subscription level resources.

QL112233

The question is what command used for deploy the template listed there, which deploys a storage account, which means deploy resource to group instead of create a resource group. So B should be right

AsymptoteOption: D

D New-AzResource - creates an Azure resource, such as a website, Azure SQL Database server, or Azure SQL Database, in a resource group. Reference: https://learn.microsoft.com/en-us/powershell/module/az.resources/new-azresource New-AzResourceGroupDeployment - adds a deployment to an existing resource group. Reference: https://learn.microsoft.com/en-us/powershell/module/az.resources/new-azresourcegroupdeployment New-AzDeployment - The New-AzDeployment cmdlet adds a deployment at the current subscription scope. This includes the resources that the deployment requires. Reference: https://learn.microsoft.com/en-us/powershell/module/az.resources/new-azdeployment Ner-AzTenanDeployment just exceeded the scope.

nchebbiOption: D

Answer is D: New-AzDeployment which is an lias to New-AzSubscriptionDeployment, the ARM template is creating a RG and a storage account, so it should be at subscription level. Take a look at this example & check the templateFile that's being used. https://github.com/MicrosoftDocs/azure-docs/blob/main/articles/azure-resource-manager/templates/deploy-to-subscription.md#powershell To people who are saying it should be B: New-AzResourceGroup, this cmdlet takes a param -ResourceGroupName of the resource group, what RG will you pass there? the one you are creating??? this one is for creating resources under that RG provided via the param ResourceGroupName

bcvOption: D

D. New-AzDeployment is correct. Option B (New-AZResourceGroup) would have been an option only if RG already existed. Here we are first creating RG so the command has to be applicable at the Subscription level which is Option D

mahesha9449295905Option: B

The New-AzResourceGroupDeployment cmdlet adds a deployment to an existing resource group

XtraWestOption: B

New-AzResourceGroupDeployment -ResourceGroupName <ResourceGroupName> -TemplateFile <TemplateFilePath> -TemplateParameterFile <ParameterFilePath>

MCI

New-AzResourceGroupDeployment: 7:02:47 PM - Error: Code=ResourceGroupNotFound; Message=Resource group 'az104test' could not be found. New-AzResourceGroupDeployment: The deployment validation failed This is the message you get when you run New-AzResourceGroupDeployment .

Christina666Option: D

I thought was B, but read the references herehttps://learn.microsoft.com/en-us/powershell/module/az.resources/new-azresourcegroupdeployment?view=azps-12.1.0, it's clearly D as we are deploying RG as well

60tiesOption: B

The deployment is TO a Resource Group.

tashakoriOption: D

D is correct

SDiwanOption: D

Coreect answer is D. The arm template is creating a resource group. So the scope of deployment must be subscription level

6Sam7Option: B

The New-AzResourceGroupDeployment cmdlet adds a deployment to an existing resource group. This includes the resources that the deployment requires. An Azure resource is a user-managed Azure entity, such as a database server, database, website, virtual machine, or Storage account. Seems B is correct

[Removed]Option: B

Answer is B We are creating RG Use New-AzDeployment for deploying resources at the subscription level. Use New-AzResourceGroupDeployment for deploying resources within a specific resource group.

MooooosaOption: B

New-AzResourceGroupDeployment- Adds an Azure deployment to a resource group. New-AzDeployment - Create a deployment at the current subscription scope. check links https://learn.microsoft.com/en-us/powershell/module/az.resources/new-azresourcegroupdeployment?view=azps-10.4.1 https://learn.microsoft.com/en-us/powershell/module/az.resources/new-azdeployment?view=azps-10.4.1

emanresuOption: D

To add resources to a resource group, use the New-AzResourceGroupDeployment which creates a deployment at a resource group. The New-AzDeployment cmdlet creates a deployment at the current subscription scope, which deploys subscription level resources. The question mentions "to create a resource group so it must be D then"

XtraWestOption: B

New-AzResourceGroupDeployment

oopspruuOption: D

The question says "to create a resource group and deploy an Azure Storage account to the resource group" You can create a resource group inside a Subscription, hence you need to use the cmdlt that deploys to a Subscription. The correct options are: use New-AzSubscriptionDeployment which is an alias of the New-AzDeployment

mark733050Option: B

If you are deploying from powershell the answer is B. New-AzResourceGroupDeployment If you are deploying from Azure CLI the answer would be "az deployment group create" The example JSON at the bottom of this page creates a resource group and storage account. https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/deploy-to-resource-group?tabs=azure-cli