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

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:

    Correct 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

Discussion
michaelmorar

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.

ki01

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

Lazylinux

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

NaoVaz

1) Tags assigned to RG1: "'tag1': 'value1' only" 2) Tags assigned to storage1: "'tag2': 'value2' and 'tag3': 'value3' only" The Resource Group already existed before the Policy was created. And the policy is for resources only not resource groups. The storage account was created with tag3 and then gets appended the tag2 because the policy.

NJTH

Simular question was on todays exam. (7th April 2023)

awssecuritynewbie

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

LiamAzure

"The resource group Tag does not pass down to the resources", why not?

xRiot007

Because tags are not inherited. If you want a tag applied you need a policy or to run a remediation task

oopspruu

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.

Indy429

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.

Indy429

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.

raj24051961

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

Novia

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

NU88

Correct Answer. This is a really good question. Confusing yet test your real world experience on Tag/Policy.

gachocop3

answer is correct. confirm it in my lab

TheUltimateGuru

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!

Trevor_VT

The resources does not inherit tags from the resource groups, so please do not use words like "100% correct", not true.

SimonSM178

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.

TrIAQ

On Exam 02/07/2024

23169fd

given answer is correct

tashakori

- tag1: value1 Only - value2 and tag3: value3 only

Tomix

RG1 Tag: tag1: value1 storage1 Tags: tag1: value1, tag3: value3, tag2: value2

JYKL88

The answer is correct. Need to follow the sequence