Your company wants to enforce tagging standards for Azure storage accounts. You need to design an Azure Policy strategy that meets the following compliance requirements:
* If a storage account is deployed without the 'Environment' tag, the deployment must be blocked.
* If a storage account is deployed without the 'CostCenter' tag, the policy should automatically add the tag with a default value of 'Unassigned' during creation.
Which two Azure Policy effects should you recommend to meet these compliance requirements?
- The Deny effect to block storage accounts without the Environment tagCevap
- The Modify effect to add the CostCenter tag with a default value during deploymentCevap
- CThe Audit effect to flag non-compliant storage accounts without the Environment tag
- DThe DeployIfNotExists effect to deploy a template that applies the CostCenter tag
Cevap
To meet the compliance requirements, you should use the Deny effect to block resource creation when the 'Environment' tag is missing, and the Modify effect to automatically add the 'CostCenter' tag with a default value during resource creation or update.
The requirement to block deployment when the 'Environment' tag is missing is met by using the Deny effect, which prevents resource creation. The requirement to automatically add the 'CostCenter' tag with a default value of 'Unassigned' during deployment is met by using the Modify effect, which can alter resource properties such as tags during creation or update.
Adım Adım Çözüm
Anahtar Kavram
Azure Policy effects determine the action taken when a policy rule matches a resource. Choosing between Deny, Modify, Audit, and DeployIfNotExists depends on whether the resource must be blocked, corrected during creation, logged for compliance tracking, or remediated after deployment.