AZ-104 Question 42
Single answerYou are managing multiple Azure resources across subscriptions. The finance department requires that all resources include a 'CostCenter' tag. You want to ensure the tag is automatically applied to newly created resources while minimizing administrative overhead. Which solution should you implement?
- A
Create a custom script that periodically checks for missing tags and applies the 'CostCenter' tag to affected resources
- B
Use Azure Alerts to notify resource owners when a 'CostCenter' tag is missing, then manually update the tag
- C
Configure an Azure Policy that appends the 'CostCenter' tag if it is not already present at resource creation
- D
Use Azure Advisor recommendations to automatically attach the 'CostCenter' tag to all resources lacking this tag
Show answer and explanation
Correct answer: C
Explanation
Azure Policy can automatically append the required 'CostCenter' tag as resources are created, ensuring compliance across resource groups and subscriptions without the need for manual intervention.
- A. Incorrect.
While a script could update tags, it is not automatic at creation time and requires custom maintenance
- B. Incorrect.
Alerts only inform you about missing tags but do not enforce or automatically apply them
- C. Correct.
Azure Policy can append required tags at resource creation, enforcing compliance without manual intervention
- D. Incorrect.
Azure Advisor provides optimization recommendations but does not automatically apply tags to resources