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

HOTSPOT

-

You have an Azure subscription that contains the resource groups shown in the following table.

You create the following Azure Resource Manager (ARM) template named deploy.json.

You deploy the template by running the following cmdlet.

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

NOTE: Each correct selection is worth one point.

    Correct Answer:

Discussion
AntaninaD

1. Yes. RG0 will be created with location from template file. For subscription level deployments, you must provide a location for the deployment. The location of the deployment is separate from the location of the resources you deploy. The deployment location specifies where to store deployment data. 2. No. Only RG0 and RG3 will be created, RG1 and RG2 already exist and can't be created. 3. No. RG3 will be created in east region. https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/deploy-to-subscription?tabs=azure-cli#deployment-location-and-name

Vokuhila

but the cmdlet has -location westus, so it should deploy in westus

Exilic

Need more discussion on this.

Halim1410

Microsoft Document for the New-AzSubscriptionDeployment cmdlet stating that the -Location parameter is for the deployment data https://learn.microsoft.com/en-us/powershell/module/az.resources/new-azdeployment?view=azps-10.3.0#parameters

bobothewiseman

questions is about the template not the deployment command

Exilic

the cmdlet says westus, not eastus.

Alandt

The "location" paramater is leading. There is another question where the cmdlet is leading.

conip

confirm - tested in LAB

Malkymagic

confirm what though?

AliNadheer

well explained. its important to note that there is a difference between the "-location" parameter in the template and in the cmdlet in template it will affect the location in which the RG will be created and in the cmdlet it will store the deployment metadata

doctor4500

WRONG! Correct Answers: 1. No. Because of location parameters RGs will be created in west us region 2. Yes. Copy 4 in arm template 3. Yes. name: [concat('RG', copyIndex())] with count 4 will produce four RG: RG0, RG1,RG2,RG3 in west us region

Lapiduse

RG1 and RG2 already exist

Sirgadget2000

The template will attempt to create 4 new RGs. It will only create 2 new RGs as RG1 and RG2 are already created in the subscription. So #2 is NO. You cannot have 2 resource groups created with the same name in the same subscription even if they are in a different region. #3 is NO.

LovelyGroovey

Based on the Azure Resource Manager (ARM) template provided in the image: 1 The template creates a resource group named RG0 in the East US Azure region: No, the template does not explicitly create a resource group named RG0. The resource groups are named by concatenating ‘RG’ with the copy index, which ranges from 0 to 3. However, the location for all resource groups is set to ‘eastus’, not specifically for RG0. 2 The template creates four new resource groups: Yes, the template includes a “copy” block with a count of 4, which means it will create four resource groups. 3 The template creates a resource group named RG3 in the West US Azure region: No, while the template does create a resource group with the name RG3 (as the copy index ranges from 0 to 3), the location for all resource groups is set to ‘eastus’. Therefore, RG3 would not be created in the West US region.

bobothewiseman

It ahould be N,N,Y When you deploy the template using the New-AzSubscriptionDeployment cmdlet with the "-Location" parameter set to "westus", it will override the location specified in the template. The location specified in the command takes precedence over the location specified in the template. Q2. No, if RG1 and RG2 already exist, the deployment will not create them again. The ARM template will create only the resource groups that do not already exist.

bobothewiseman

I take it back. Final answer is YNN question is about template not the deployment command. The other question is about deployment command

S4L4LMF

Im not 100% sure on this but i think its: Y > copyindex starts with 0 and location is predefined in the ARM template N > RG1 & RG2 already exists. Since it uses the copyindex as postfix, this will fail (it starts with 0, then 1, 2, 3 but 1 and 2 already exists) N > location is predefined in de ARM template which is EAST US

YesPlease

1) Yes: Template controls location of RGs being created. The "-Location" in command refers to where the deployment data is going to be saved: https://learn.microsoft.com/en-us/powershell/module/az.resources/new-azdeployment?view=azps-10.4.1#-location 2) No. RG1 and RG2 already exist and you can't have duplicate names for Resource Groups. 3) No. Template dictates the location of where the RG are being created.

Cremela

Answer should be NNY: Resources should end up in westus. RG1 and RG2 already exists so they won't be created.

Amir1909

Yes No No

Sakadia

Answers should be: 1. Yes -->The location of the deployment is separate from the location of the resources you deploy 2. No --> For each deployment name, the location is immutable. You can't create a deployment in one location when there's an existing deployment with the same name in a different location. In this example RG2 is in west us so you will not be able to deploy the resource group RG2 3. No --> RG3 will be created in the east us region see reasoning in point 1. Answers are found here: https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/deploy-to-subscription?tabs=azure-cli#deployment-location-and-name

Sakadia

Additionaly to Answer 1: The "Concat"-Functions starts the count at 0

SofiaLorean

Should be Yes, No, No

Globus777

Guys, really New-AzSubscriptionDeployment - can't find this command, N- N-N

WeepingMaplte

Huh? Please don't give missing answer when you don't even bother searching in Microsoft Learn. https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/create-resource-group#:~:text=For%20the%20PowerShell%20deployment%20command%2C%20use%20New%2DAzDeployment%20or%20its%20alias%20New%2DAzSubscriptionDeployment.

LovelyGroovey

Based on the Azure Resource Manager (ARM) template provided in the image: The template creates a resource group named RG0 in the East US Azure region: No, the template does not explicitly create a resource group named RG0. The resource groups are named by concatenating ‘RG’ with the copy index, which ranges from 0 to 3. However, the location for all resource groups is set to ‘eastus’, not specifically for RG0.