Topic: AZ-104 topic 2 question 95

HOTSPOT
-

You purchase a new Azure subscription.

You create an Azure Resource Manager (ARM) template named deploy.json as shown in the following exhibit.



You connect to the subscription and run the following command.

New-AzDeployment –Location westus –TemplateFile “deploy.json”

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

NOTE: Each correct selection is worth one point.

Re: AZ-104 topic 2 question 95

NNY - I run the ARM template in a lab environment. Before go to the explanation, it's valid to say that there are some errors in the script format and I have to fix it to run successfully.

1- It's N, because it creates 4 Resource Groups and not 3 Resource Groups (RGS0, RGS1, RGroup4 and ResGrp8);
1.1: The Resource Group named with "[concat('RGS', copyIndex())]", creates RGS0 and RGS1;
1.2: The Resource Group named with "[concat('ResGrp', '8')]", creates ResGrp8;
1.3: The Resource Group named with "[concat('RGroup', length(parameters('obj1')))]", creates RGroup4 (As we can see, obj1 parameter has a length of 4  'propA', 'propB', 'propC' and 'propD');
2 - It's N, because it doesn't create a resourcer group named RGroup5;
3 - It's Y, because all resource groups were created in the East US Azure Region.

Re: AZ-104 topic 2 question 95

for the third one u give the input parameter as westus so it has to be No right ?

Re: AZ-104 topic 2 question 95

No. It's is different! When you specify the location with a template, the location tells Azure Resource Manager where to store the deployment data.

"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. Management group and tenant deployments also require a location. For resource group deployments, the location of the resource group is used to store the deployment data."

References:
https://learn.microsoft.com/en-us/powershell/module/az.resources/new-azdeployment?view=azps-10.4.1#description

https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/deploy-to-subscription?tabs=azure-cli#deployment-location-and-name

Re: AZ-104 topic 2 question 95

Why The Resource Group named with "[concat('RGS', copyIndex())]", creates RGS0 and RGS1?

Re: AZ-104 topic 2 question 95

Count property

Re: AZ-104 topic 2 question 95

because of the "copy" and "count" property
copy...means the 1st created resource group should be duplicated
count...how manytimes should it be duplicated..."2" (twice)
and [concat('RGS', copyIndex())] means the name of the created RGs should be derived from joining (concat) the words (string) "RGS" with the copyindex number of each created RG (ie 1st created RG...copyindex number "0", 2nd created RG copyindex number "1")....as we all know counting in prog lang. often begin with 0, 1, 2 and not 1

Re: AZ-104 topic 2 question 95

count: how many instance of the RG should exist...sorry my english isnt too good

Re: AZ-104 topic 2 question 95

If it doesn't run successfully because of the errors, shouldn't you just say no to all? You are not supposed to assume that the errors are fixed when running it.

Re: AZ-104 topic 2 question 95

Just from looking at it, I can see at least one error, which is the reference of "par1", written as "part1".

Re: AZ-104 topic 2 question 95

microsoft willfully put it like that because the is default value for location which is "EAST US"  if a location is not specify or empty it will default to that or wrong specification

Re: AZ-104 topic 2 question 95

You can also assume that it is a transcription error. Just consider both possibilities when taking the exam and read carefully

Re: AZ-104 topic 2 question 95

NNY,
1: No,  to my count there will be 4 resources deployed
2: No, the length(parameters('obj1')) count will result in 4, as there are top-level properties.
3: Yes, the -location parameter given only effects what region the deployment would happen in, the resourcses location are defined by the template, and in this case the first two get an explicit eastus, the second refers to the last item in the list which is eastus and the third gets the default value of it which is again eastus

Re: AZ-104 topic 2 question 95

1: there is a typo mistake in 1-st RG but I still wondering, how did you get 4 resource groups?

Re: AZ-104 topic 2 question 95

There's 3 RGs in the template for East-Us. Hence, if you create 1 RG for West-US, it would be the 4th RG

Re: AZ-104 topic 2 question 95

NNN as written because of syntax errors, it fails until all are fixed

Fixing:
"location": "[parameters('part1')]" to
    "location": "[parameters('par1')]"
"type": "Microsoft.Resources/resrouceGroups" to
    "type": "Microsoft.Resources/resourceGroups"

Yields:
No – It creates 4 – RGS0, RGS1, ResGrp8, RGroup4 (len of PropA-D)
No – See above
Yes – tested in Lab

Re: AZ-104 topic 2 question 95

NNY
N: Two copies + two groups (total 4)
N: RGS 0, RGS 1, ResGrp 8, RGroup 4
Y: Location eastus, last() takes last value from array so eastus, deafaultvalue eastus

Re: AZ-104 topic 2 question 95

lot of confusion around these Yes-No questions. Folks who don't know the correct answer kindly refrain providing your inputs here. Neither the ChatGPT plethora of knowledge is needed here. please, don't add to confusion,  this az-104 is the only exam on ET where i see people creating a mess.

Re: AZ-104 topic 2 question 95

Answer is NNN
1st box :  4 resource groups (RGS0, RGS1, RGroup4 and ResGrp8)
2nd box:  RGS0, RGS1, RGroup4 and ResGrp8
3rd box: all resources groups were created in West US
the location specified in the deployment command acts as the target deployment location for the entire deployment process, and all resources defined within the ARM template will be deployed to that specified location, regardless of any location properties defined within the individual resource definitions in the template.

https://learn.microsoft.com/en-us/powershell/module/az.resources/new-azdeployment?view=azps-10.4.1#description
https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/deploy-to-subscription?tabs=azure-cli#deployment-location-and-name

Re: AZ-104 topic 2 question 95

No
No
Yes

Re: AZ-104 topic 2 question 95

answer is N N Y

Re: AZ-104 topic 2 question 95

N : Because resource first has a copy property then create groups size is 4
N : Is obvious not exist RGroup 5 for the conditions
Y : All resource is create East accordint the ARM

Re: AZ-104 topic 2 question 95

YNY
There is a typo on the par1 reference to the 4th RGS, so only three RGs would be deployed.
The other three would be deployed on East US

Re: AZ-104 topic 2 question 95

With that typo, the template would not execute.

Re: AZ-104 topic 2 question 95

bro stop killing the excitement of learning.. you are literally creating a whole discussion just for a TYPO?? ???????????????????