AZ-104 Question 45
Single answerYou are an Azure Administrator for Contoso. You have been directed to ensure that all resources, both existing and newly created, within the 'DevRG' resource group have a specific tag of 'Environment: Development.' You want to enforce and automatically apply this tag using Azure Policy. Which policy effect should you use to achieve this requirement?
- A
Append
- B
Deny
- C
DeployIfNotExists
- D
Modify
Show answer and explanation
Correct answer: D
Explanation
Using the ‘Modify’ policy effect in Azure Policy ensures that tags are applied to both existing and newly created resources. Other effects such as ‘Append’, ‘Deny’, and ‘DeployIfNotExists’ do not fulfill the need to proactively remediate tags on resources already in place.
- A. Incorrect.
‘Append’ adds the specified tag only to newly created resources and does not remediate existing resources.
- B. Incorrect.
‘Deny’ blocks the creation or update of resources that do not meet the policy requirements but does not automatically add or update tags on existing resources.
- C. Incorrect.
‘DeployIfNotExists’ is used to deploy a resource if it does not exist, which is not relevant to simply adding or enforcing tags on existing resources.
- D. Correct.
‘Modify’ can automatically apply or update tags to both existing and newly created resources, which meets the requirement of ensuring all resources have the ‘Environment: Development’ tag.