exam questions

Exam AZ-104 All Questions

View all questions & answers for the AZ-104 exam

Exam AZ-104 topic 2 question 48 discussion

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

HOTSPOT -
You have an Azure subscription named Sub1 that contains the Azure resources shown in the following table.

You assign an Azure policy that has the following settings:
✑ Scope: Sub1
✑ Exclusions: Sub1/RG1/VNET1
✑ Policy definition: Append a tag and its value to resources
✑ Policy enforcement: Enabled
✑ Tag name: Tag4
✑ Tag value: value4
You assign tags to the resources as shown in the following table.

For each of the following statements, select Yes if the statement is true. Otherwise, select No.
NOTE: Each correct selection is worth one point.
Hot Area:

Show Suggested Answer Hide Answer
Suggested Answer:
Box 1: No -
The Azure Policy will add Tag4 to RG1.

Box 2: No -
Tags applied to the resource group or subscription aren't inherited by the resources although you can enable inheritance with Azure Policy. Storage1 has Tag3:
Value1 and the Azure Policy will add Tag4.

Box 3: No -
Tags applied to the resource group or subscription aren't inherited by the resources so VNET1 does not have Tag2.
VNET1 has Tag3:value2. VNET1 is excluded from the Azure Policy so Tag4 will not be added to VNET1.
Reference:
https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/tag-resources?tabs=json

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
Lionred
Highly Voted 3 years, 2 months ago
N, N, N 1st No: Azure policy was created before the RG1 was assigned tag, which means when RG1 was manually assigned tag Tag2:IT, the policy will take action to append Tag4:vaule4 to RG1. Note that policy action is to "append", that means whatever else tag RG1 is given won't be taken away. As such RG1 will have two tags, Tag2:IT and Tag4:value4 2nd No: Remember tags are not inheritable, whatever tag assigned to RG1 won't be applied to any resources under it. As such the Storage1 should be Tag3:value1 and Tag4:vaule4. 3rd No: vNet1 is excluded from the Azure policy, hence the policy won't do anything to it. As such vNet1 should only have the tag manually assigned: Tag3:value2. PS, I take that "Exclusions: Sub1/RG1/VNET1" does not mean both RG1 & vNet1 are excluded, only vNet1 is excluded, the Sub1/RG1/VNET1 is merely a path to the object that is excluded.
upvoted 231 times
DalyMasmoudi
2 months, 4 weeks ago
The Azure Policy is assigned to add the tag Tag4:value4 to resources in a subscription Sub1, except for VNET1. However, the policy does not apply to existing resources because remediation (auto-correction) is not enabled. So the correct Answer is: Y: RG1 has the Tag2:IT tag assigned only Reason: RG1 receives the tag Tag2:IT because it is explicitly assigned in the policy and is not affected by the exclusion. N: Storage1 has the Tag1:subscription, Tag2:IT, Tag3:value1, and Tag4:value4 tags assigned. Reason: Although Storage1 has several tags assigned, the policy does not apply to this existing resource because remediation is not enabled. N: VNET1 has the Tag3:value2 assigned only. Reason: VNET1 is excluded from the policy, so no tags are assigned to this resource.
upvoted 8 times
...
S3ktar
3 years, 2 months ago
Not true, if the RG1 exists before the policy is in place, it will not apply the tags. This is even true if you go into the resource to add the tags as mentioned in the question, it will not apply the policy rules just because you are adding a tag. The result of this will be that the resources will only be tagged as not compliant until it is fixed. Source: I tested it in the portal
upvoted 33 times
S3ktar
3 years, 2 months ago
Correct answer is y-n-n
upvoted 60 times
...
marioZuo
1 year, 7 months ago
I tested also, but the tag is appended automatically on my side.
upvoted 3 times
...
mufflon
3 years, 1 month ago
Are you sure? When you are updating the resources with tags according to "You assign tags to the resources as shown in the following table" then , dont you update the resource and the policy activates? A policy adds the by the policy specified tag and value when any resource missing the tag is created or updated, so it vill add Tag4 with value: value4
upvoted 2 times
albergd
3 years ago
The trick is not there, the trick is in the policy: "Append a tag and its value to resources" : this policy does not apply to Resource Groups. You can check here: https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/tag-policies To apply the policy to a RG you need to use "Append a tag and its value to resource groups". The answer is Y-N-N
upvoted 73 times
Abdou001
2 years ago
@Albergd, you convinced me. Thanks !
upvoted 3 times
...
...
...
...
dimsok
2 years, 1 month ago
Y-N-N, RG1 is exluded
upvoted 24 times
happpieee
4 months, 1 week ago
Y-N-N. This is correct. RG1 is excluded in the Azure policy (I am guessing the questions is tweaked here and there over time). And tags does not inherits for the remaining: https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/tag-resources?tabs=json#inherit-tags
upvoted 3 times
...
Mshaty
5 months, 1 week ago
RG1 is not excluded what is excluded Vnet1 which is in RG1
upvoted 4 times
...
...
juniorccs
2 years, 9 months ago
this is just wron
upvoted 1 times
...
...
testmobile18
Highly Voted 3 years, 2 months ago
Wouldn't it be Y-N-N? Y - RG1 is excluded thus retain as it is N - Storage1 will have Tag3:value1 and Tag4:value4 N - VNET1 is excluded as well so only have Tag3:value2
upvoted 134 times
gofto
3 years, 2 months ago
doubt that this explanation is correct
upvoted 4 times
...
Edward2021
3 years, 2 months ago
I think the same!!! Y N N
upvoted 10 times
...
olsenOnS
3 years, 2 months ago
Correct, Y - RG1 has its own tag, and is excluded from policy N N
upvoted 8 times
...
maatksle
3 years, 2 months ago
Dude, you're wrong. Please refer to Lionred's answer. RG1 has already a tag to it and the policy appends the tag not take away and add. Guys, please upvote his answer.
upvoted 9 times
mufflon
3 years, 1 month ago
First you have the resources specified, they you assign a policy that says Tag name: Tag4 and Tag value: value4. Then you assign tags to the resources as shown in the table. When assigning tags to the resources, the resources gets updated and the policy gets activated and adds its tag. https://www.examtopics.com/exams/microsoft/az-104/view/9/#
upvoted 1 times
...
...
...
manishk39
Most Recent 1 month, 2 weeks ago
NNN, Appends the specified tag and value when any resource which is missing this tag is created or updated. Does not modify the tags of resources created before this policy was applied until those resources are changed. Does not apply to resource groups.
upvoted 1 times
...
bacana
4 months ago
YNN Police only add tags if you set the remediation option. Tags remain the same whether the police apply them or not. Test it out if you don't believe me
upvoted 2 times
...
stcr
4 months ago
Y, N, N Append a tag and its value to resources Appends the specified tag and value when any resource which is missing this tag is created or updated. Does not modify the tags of resources created before this policy was applied until those resources are changed. Does not apply to resource groups. New 'modify' effect policies are available that support remediation of tags on existing resources (see https://aka.ms/modifydoc). https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/tag-policies So this policy - never applies to resource groups - Exclusion: "Optionally select resources to exclude from the policy assignment." - the resource group is already there By default, this assignment will only take effect on newly created resources. Existing resources can be updated via a remediation task after the policy is assigned. For deployIfNotExists policies, the remediation task will deploy the specified template. For modify policies, the remediation task will edit tags on the existing resources.
upvoted 3 times
...
LinuxLewis
4 months ago
NO --- RG1 created > policy with scope Sub1 assigned > path excludes only VNET1 > so RG1 is a resource of Sub1 > tag2+tag4 NO --- storage created > carries tag3 > tag4 policy enforced > other tags are not inherited NO --- VNET1 is excluded > no tag4 > only tag3 remains my thoughts...
upvoted 1 times
...
rodrod
4 months, 1 week ago
how can it be a path and not a list?? a path would be /subscriptions/Sub1/resourceGroups/RG1/providers/Microsoft.Network/virtualNetworks/VNET1 very confusing...
upvoted 1 times
...
feralberti
4 months, 2 weeks ago
there seems to be alot of confusion on the first options: i believe it to be a N. RG1 is not excluded from the policy and the policy will add Tag4 to the already existing Tag2. The policy ONLY excludes Vnet1
upvoted 1 times
...
[Removed]
6 months ago
Wrong Yes No No
upvoted 3 times
...
ELearn
6 months ago
1) RG1 has the Tag2: IT tag assigned only. Since RG1 is not excluded and the policy applies to all resources in Sub1, the policy will add Tag4: value4 to RG1. So, RG1 will have Tag2: IT and Tag4: value4. Answer: No 2) storage1 has the Tag1: subscription, Tag2: IT, Tag3: value1, and Tag4: value4 tags assigned. storage1 is under the Sub1 and not excluded from the policy. Initially, it has Tag3: value1. The policy will append Tag4: value4. It is not specified that Tag1: subscription or Tag2: IT is applied to storage1. Only the tags mentioned in the table and policy enforcement apply. Answer: No 3) VNET1 has the Tag2: IT and Tag3: value2 tags assigned only. VNET1 is specifically excluded from the policy. It already has Tag3: value2 and no other tags from the table or policy are applied. There is no mention of Tag2: IT being assigned to VNET1. Answer: No
upvoted 2 times
ELearn
6 months ago
NB: The forward slashes in the exclusion path "Sub1/RG1/VNET1" indicate a hierarchical relationship, not separate exclusions. This format specifies that the exclusion applies to the VNET1 resource located within the RG1 resource group, under the Sub1 subscription. So, it does not exclude Sub1 or RG1 independently. It only excludes the specific resource VNET1, ensuring that only this virtual network is unaffected by the policy.
upvoted 3 times
...
...
CheMetto
7 months, 1 week ago
YNN! Remember: Even if enforce policy might think is enforced for everything, it doesn't mean this way! To apply a tag to pre-existence resource with azure policy, the only way is to do a remediation task, nothing else. The meaning of enforce policy is what azure policy will do. In this case, if you disable enforce policy it will put the resource in "Non compliant state" and send a custom message. If you enable enforce policy, it will force what it has to do, so in this case apply a tag.
upvoted 2 times
...
OpOmOp
7 months, 4 weeks ago
I dont know why subs1 will get tag4. When you assign the policy you have this warning: By default, this assignment will only take effect on newly created resources. Existing resources can be updated via a remediation task after the policy is assigned
upvoted 1 times
...
2dc6125
9 months ago
Y,n,n. IT tag already exists and policy has append action so will not remove the existing tag
upvoted 1 times
...
3c5adce
9 months, 3 weeks ago
ChatGPT4 - NNY
upvoted 1 times
...
Wassel_Laouini
10 months, 2 weeks ago
Y-N-N, the policy excluded RG1, meaning it has no tag(the tag4), all good now? then it said you assign a tag1 to RG1, which you can because it has nothing to do with the policy
upvoted 1 times
...
mkhlszf
11 months ago
Two things to notice: "Sub1/RG1/VNET1" reads as a path not a list, so it only applies to VNET1 and not RG1 and Sub1 The tag does not appliy to RG1 because it is a resource group and the policy specifies "Append a tag and its value to resources" so it will only apply to resources, no resource groups. Therfore, answer is. Y N N
upvoted 5 times
...
promartyr
11 months, 2 weeks ago
"Exclusions: Sub1/RG1/VNET1": IT MEANS : "the virtual network called VNet1 (which is inside Resource Group RG1, and inside Subscription called Sub1) is excluded from the policy" IT DOES NOT MEAN: "Sub1 _and_ RG1 _and_ VNet1 are excluded from the policy"
upvoted 18 times
HichemCFE
2 months, 1 week ago
yes but the policy :tag append only ressource : y,n,n
upvoted 1 times
...
Aadhithya
10 months, 4 weeks ago
This is the best explanation for the exclusion criteria
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