exam questions

Exam AZ-104 All Questions

View all questions & answers for the AZ-104 exam

Exam AZ-104 topic 4 question 38 discussion

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

HOTSPOT -
You have an Azure subscription named Subscription1 that contains the following resource group:
✑ Name: RG1
✑ Region: West US
✑ Tag: `tag1`: `value1`
You assign an Azure policy named Policy1 to Subscription1 by using the following configurations:
✑ Exclusions: None
✑ Policy definition: Append a tag and its value to resources
✑ Assignment name: Policy1
✑ Parameters:
✑ Tag name: tag2

Tag value: value2 -

After Policy1 is assigned, you create a storage account that has the following configuration:
✑ Name: storage1
✑ Location: West US
✑ Resource group: RG1
✑ Tags: `tag3`: `value3`
You need to identify which tags are assigned to each resource.
What should you identify? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.
Hot Area:

Show Suggested Answer Hide Answer
Suggested Answer:
Box 1: "tag1": "value1" only -
Box 2: "tag2": "value2" and "tag3": "value3" only
Tags applied to the resource group are not inherited by the resources in that resource group.
Reference:
https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-using-tags

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
michaelmorar
Highly Voted 2 years, 10 months ago
Tag assigned to RG1 - tag1: value1 Tag assigned to storage1: tag2: value2 and tag3: value3 RG1 already exists so does not receive tag2. According to the documentation: "Add a tag to resources" Adds the specified tag and value when any resource missing this tag is created or updated. Existing resources can be remediated by triggering a remediation task. If the tag exists with a different value it will not be changed. Does not modify tags on resource groups.
upvoted 104 times
Mitko_V_Milkov
2 months, 3 weeks ago
The key word here is "Append", which means that it is not "retroactive". Because RG1 already exists and we have "Append" in the policy statement, the tag from the policy will not be added to RG1. Ref: The term "Append" (not retroactive) in the context of Azure Policy means: Append Policy Definition The Append effect ensures that the specified tag (or other properties) is added to a resource at the time of its creation or modification if it doesn't already exist. It does not apply retroactively to resources that already exist before the policy was assigned unless those resources are updated after the policy is applied.
upvoted 2 times
...
MiniLa92
2 months ago
Tag assigned to RG1 - tag1: value1 Tag assigned to storage1: tag2: value2 and tag3: value3
upvoted 1 times
...
ki01
1 year, 2 months ago
correct answer but incorrect reasoning. Assigning a policy goes through all the items that might be affected. meaning this new policy would go through resources and check if they fit the filters to take action on. in this case, RG1 doesnt get anything assigned to it because resource groups are not considered resources. if the first part was not a resource group but lets say a VM, then the policy would have added (appended) another tag to already existing one and it would have 1 and 2. in case of the storage account, that is considered a resource so it keeps its own tag 3 and the policy adds tag 2 alongside it
upvoted 11 times
...
...
Lazylinux
Highly Voted 2 years, 8 months ago
I was not sure til i read the following, i think part important to pay attention to it the "Append a tag and its value to resources" and as per below 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). Ans is Tag assigned to RG1 - tag1: value1 Tag assigned to storage1: tag2: value2 and tag3: value3 https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/tag-policies
upvoted 28 times
...
[Removed]
Most Recent 5 months, 4 weeks ago
CORRECT
upvoted 2 times
...
TrIAQ
8 months ago
On Exam 02/07/2024
upvoted 2 times
...
23169fd
9 months, 1 week ago
given answer is correct
upvoted 1 times
...
tashakori
11 months, 2 weeks ago
- tag1: value1 Only - value2 and tag3: value3 only
upvoted 1 times
...
Novia
1 year, 2 months ago
Tag assigned to RG1 - tag1: value1 and tag2: value2 Tag assigned to storage1: tag2: value2 and tag3: value3 Virtual machines, storage accounts, web apps, databases, and virtual networks are examples of resources. Resource groups, subscriptions, management groups, and tags are also examples of resources. https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/overview
upvoted 2 times
...
NU88
1 year, 2 months ago
Correct Answer. This is a really good question. Confusing yet test your real world experience on Tag/Policy.
upvoted 2 times
...
Indy429
1 year, 2 months ago
Correct. RG is not a resource in itself, so it will only have tag 1. Tag 2 is a policy for resources only, and tag 3 was created for the storage account. The storage account has tag 2 as per the policy settings, and obivously has tag 3 associated as per the settings on the resource itself.
upvoted 4 times
Indy429
1 year, 2 months ago
Also, the storage account does not have tag 1, as tags applied to RGs are not automatically passed down to it's resources. You would need to create a separate policy for that.
upvoted 3 times
...
...
gachocop3
1 year, 6 months ago
answer is correct. confirm it in my lab
upvoted 2 times
...
oopspruu
1 year, 6 months ago
As of 17/08/2023, confirmed in Lab. "Append a tag and its value to resources" does not take effect on Resource Groups, only on Resources. Also, the policy applies on newly created or updated resources only. The existing resources will stay as is. So given answer is correct. Created same policy as shown here > Waited 1 Hour > Created new RG > no tags applied from policy. Created Storage Account & VM > tag from policy applied to both.
upvoted 5 times
...
[Removed]
1 year, 8 months ago
Correct answer: Correct answer: Tag assigned to RG1 - tag1: value1 and tag2: value2 -> tag2 inherit from the policy Tag assigned to storage1: tag2: value2 and tag3: value3 -> tag2 inherit from the policy Inherit tags Resources don't inherit the tags you apply to a resource group or a subscription. To apply tags from a subscription or resource group to the resources, see Azure Policies - tags. https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/tag-resources
upvoted 3 times
...
Tomix
1 year, 8 months ago
RG1 Tag: tag1: value1 storage1 Tags: tag1: value1, tag3: value3, tag2: value2
upvoted 2 times
...
NJTH
1 year, 11 months ago
Simular question was on todays exam. (7th April 2023)
upvoted 9 times
...
TheUltimateGuru
1 year, 11 months ago
This is 100% the correct answer to this question: Tag assigned to RG1 - tag1: value1 Tag assigned to storage1: tag1: value1, tag2: value2 and tag3: value3 Storage1 inherits 'tag1: value1' from RG1 also as storage1 was created in this resource group after it's creation and tags are indeed inherited from the resource group IF created after tags are applied to the resource group. Slight technicality will catch many people out!
upvoted 2 times
Trevor_VT
1 year, 11 months ago
The resources does not inherit tags from the resource groups, so please do not use words like "100% correct", not true.
upvoted 11 times
...
SimonSM178
1 year, 11 months ago
that's actually 100% wrong, no documentation states that resources inherit the resource group tag. as a matter of fact, it's the opposite: resource DO NOT inherit the tag of the resource group they belong to.
upvoted 12 times
...
...
JYKL88
2 years, 2 months ago
The answer is correct. Need to follow the sequence
upvoted 1 times
...
awssecuritynewbie
2 years, 4 months ago
The resource group Tag does not pass down to the resources. so Tag1: value 1 will never make it to the storage account. But the AZURE POLICY set at the SUB level will be passed down to the NEW RESOURCES ONLY. so it will be Tag2: value 2 and Tag 3
upvoted 6 times
LiamAzure
2 years, 3 months ago
"The resource group Tag does not pass down to the resources", why not?
upvoted 1 times
xRiot007
1 year, 9 months ago
Because tags are not inherited. If you want a tag applied you need a policy or to run a remediation task
upvoted 1 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