exam questions

Exam AZ-104 All Questions

View all questions & answers for the AZ-104 exam

Exam AZ-104 topic 4 question 95 discussion

Actual exam question from Microsoft's AZ-104
Question #: 95
Topic #: 4
[All AZ-104 Questions]

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.

Show Suggested Answer Hide Answer
Suggested Answer:

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
AntaninaD
Highly Voted 1 year, 6 months ago
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
upvoted 80 times
duongduong_me
3 months ago
I have tested: Y N N: Only RG0 and RG3 were created newly in Eastus Error Message: PS /home/duong> New-AzSubscriptionDeployment -Location westus -TemplateFile template.json New-AzDeployment: 12:41:52 AM - The deployment 'template' failed with error(s). Showing 1 out of 1 error(s). Status Message: Invalid resource group location 'eastus'. The Resource group already exists in location 'westus'. (Code:InvalidResourceGroupLocation) CorrelationId: 42d3b336-13c1-49e7-a4fa-acafcd3262bf
upvoted 3 times
...
Josh219
3 months, 2 weeks ago
Your answer is correct !! Perfect explanation
upvoted 2 times
...
Exilic
1 year, 6 months ago
the cmdlet says westus, not eastus.
upvoted 3 times
Alandt
1 year, 1 month ago
The "location" paramater is leading. There is another question where the cmdlet is leading.
upvoted 1 times
...
...
Vokuhila
1 year, 6 months ago
but the cmdlet has -location westus, so it should deploy in westus
upvoted 4 times
bobothewiseman
11 months ago
questions is about the template not the deployment command
upvoted 3 times
...
Exilic
1 year, 5 months ago
Need more discussion on this.
upvoted 1 times
...
Halim1410
1 year, 5 months ago
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
upvoted 5 times
...
...
...
doctor4500
Highly Voted 1 year, 6 months ago
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
upvoted 30 times
alsmk2
6 months, 3 weeks ago
Location in the powershell cmd is for deployment metadata, not where the resources will be deployed. The template handles that.
upvoted 2 times
...
bobothewiseman
11 months, 2 weeks ago
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.
upvoted 3 times
bobothewiseman
11 months ago
I take it back. Final answer is YNN question is about template not the deployment command. The other question is about deployment command
upvoted 3 times
pasangawa
6 months ago
it did mention 'You deploy the template by running the following cmdlet.' so it should be asking what template does. If its just pertaining to template, then all should be No isn't it? since template itself doesnt do anything until you apply it. I chose NNY which was your original answer.
upvoted 1 times
...
...
...
LovelyGroovey
11 months, 3 weeks ago
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.
upvoted 1 times
...
Lapiduse
1 year, 6 months ago
RG1 and RG2 already exist
upvoted 7 times
...
...
adanit2011
Most Recent 1 week, 3 days ago
Yes - Because it will concatenate the 'RG' with the copy values. No - To create 4 new resource groups, the -mode complete should have been declared in the command. Since it wasn't, it will use the default, which is Incremental, thus RG2 and RG3 already exist. No - Because the location is already defined in the template with eastus.
upvoted 1 times
...
Megabyte10
4 months, 1 week ago
1. Yes -location of the resource group is specified in the arm template, which is eastus 2. Yes - the template does create four new resource groups, despite RG1 &RG2 existing due to the copyindex function in the template. It will dynamically move on to a number that is available like RG3, RG4 &RG5. 3. No the template is for eastUS only.
upvoted 4 times
...
LuLaCeK
4 months, 2 weeks ago
TESTED: deploy.json create 4 resource groups, first is named RG0, all are created in eastus region.
upvoted 1 times
...
[Removed]
5 months ago
WRONG Yes No No ..
upvoted 3 times
SaadKhamis
1 month, 3 weeks ago
YNN After running the PS1 command: PS /home/azure1> New-AzSubscriptionDeployment -Location westus -TemplateFile ./deploy.json New-AzDeployment: 8:02:52 PM - The deployment 'deploy' failed with error(s). Showing 1 out of 1 error(s). Status Message: Invalid resource group location 'eastus'. The Resource group already exists in location 'westus'. (Code:InvalidResourceGroupLocation) CorrelationId: e81b1950-15cf-41c6-88b7-aaa3b46cbdd4 This a list of existing RGs: Name Subscription Location RG0 Visual Studio East US RG1 Visual Studio East US RG2 Visual Studio West US RG3 Visual Studio East US
upvoted 1 times
...
...
[Removed]
5 months, 1 week ago
WRONG Yes No No
upvoted 1 times
...
alsmk2
6 months, 3 weeks ago
YNN Very simple - RG2 & 3 already exist, so it can't create them. Therefor it will create two RG's - RG0 and RG3. For location, the arm template specifies the location as eastus, so the two new RGs will be created in that region. The powershell command to utilise the template specifies a location of westus, but that is for the deployment metadata, not the resources themselves.
upvoted 3 times
...
SofiaLorean
8 months, 1 week ago
Should be Yes, No, No
upvoted 1 times
...
Globus777
10 months, 2 weeks ago
Guys, really New-AzSubscriptionDeployment - can't find this command, N- N-N
upvoted 1 times
WeepingMaplte
10 months, 1 week ago
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.
upvoted 2 times
...
...
Amir1909
11 months, 2 weeks ago
Yes No No
upvoted 2 times
...
LovelyGroovey
11 months, 3 weeks ago
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.
upvoted 1 times
...
S4L4LMF
1 year, 4 months ago
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
upvoted 8 times
...
YesPlease
1 year, 4 months ago
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.
upvoted 4 times
...
Sakadia
1 year, 5 months ago
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
upvoted 2 times
Stunomatic
4 months, 1 week ago
you only making sense to me. thanks
upvoted 1 times
...
Sakadia
1 year, 5 months ago
Additionaly to Answer 1: The "Concat"-Functions starts the count at 0
upvoted 1 times
...
...
Cremela
1 year, 5 months ago
Answer should be NNY: Resources should end up in westus. RG1 and RG2 already exists so they won't be created.
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
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.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago