Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.
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?
Suggested Answer:B🗳️
Deployment scope. You can target your deployment to a resource group, subscription, management group, or tenant. Depending on the scope of the deployment, you use different commands. To deploy to a resource group, use New-AzResourceGroupDeployment. Incorrect: Not C: To deploy to a tenant, use New-AzTenantDeployment. Not D: To deploy to a subscription, use New-AzSubscriptionDeployment which is an alias of the New-AzDeployment cmdlet. To deploy to a management group, use New-AzManagementGroupDeployment. Not A: The New-AzResource cmdlet creates an Azure resource, such as a website, Azure SQL Database server, or Azure SQL Database, in a resource group. Reference: https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/deploy-powershell
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."
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.
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
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.
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
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
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"
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
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
Answer(s): B
Explanation:
Deployment scope.
You can target your deployment to a resource group, subscription, management group, or tenant. Depending on the scope of the deployment, you use different commands.
To deploy to a resource group, use New-AzResourceGroupDeployment.
Incorrect:
Not C: To deploy to a tenant, use New-AzTenantDeployment.
Not D: To deploy to a subscription, use New-AzSubscriptionDeployment which is an alias of the New-AzDeployment cmdlet.
To deploy to a management group, use New-AzManagementGroupDeployment.
Not A: The New-AzResource cmdlet creates an Azure resource, such as a website, Azure SQL Database server, or Azure SQL Database, in a resource group.
Reference:
https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/deploy-powershell
To deploy an Azure Resource Manager (ARM) template, you can use the New-AzResourceGroupDeployment cmdlet in Azure PowerShell. This cmdlet allows you to deploy a template to a resource group.
I'm with D as per below URL.
https://learn.microsoft.com/en-us/powershell/module/az.resources/new-azdeployment?view=azps-10.0.0&viewFallbackFrom=azps-9.7.0
You're adding RG and Storage not resources.
From URL;
The New-AzDeployment cmdlet adds a deployment at the current subscription scope. This includes the resources that the deployment requires.
An Azure resource is a user-managed Azure entity. A resource can live in a resource group, like database server, database, website, virtual machine, or Storage account. Or, it can be a subscription level resource, like role definition, policy definition, etc.
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.
IMHO its B:
as your quote says:
storage account goes into RG. so you need to use New-AzResourceGroupDeployment
New-AzDeployment cmdlet creates a deployment at the current subscription scope, which deploys subscription level resources.
Answer: D. New-AzDeployment
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.
Ref: https://learn.microsoft.com/en-us/powershell/module/az.resources/new-azdeployment?view=azps-9.7.0
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Tinkers69
Highly Voted 1 year, 2 months agoskydivex
9 months, 2 weeks agoTarni
1 year, 2 months agoAsymptote
Highly Voted 1 year, 1 month agonchebbi
Most Recent 3 weeks, 2 days agoMooooosa
1 month, 3 weeks agoXtraWest
2 months agoemanresu
2 months agoXtraWest
2 months, 3 weeks agooopspruu
3 months, 3 weeks agomark733050
3 months, 3 weeks agofjreoi
3 months, 4 weeks agoTeroristo
4 months, 1 week agoeduardokm
4 months, 1 week agoJosete1106
4 months, 3 weeks agoXtraWest
5 months agoTomix
5 months, 1 week agoRandomNickname
6 months, 1 week agoconip
2 months, 3 weeks agomaxustermann
6 months, 3 weeks agovinsom
7 months, 1 week ago