Skill 1.3.1
Implement and manage Azure Policy
Key Concepts
A policy definition contains an if condition on resource properties and a then effect. The main effects are Deny (block the request), Audit (allow but mark non-compliant), Append and Modify (add or change properties such as tags), AuditIfNotExists and DeployIfNotExists (check or deploy a related resource, such as a diagnostic setting), DenyAction (block delete operations) and Disabled. An initiative (policy set) groups related definitions so that they are assigned and reported together; Microsoft provides built-in definitions and initiatives such as Allowed locations and the Microsoft cloud security benchmark.
A definition does nothing until it is assigned to a management group, subscription or resource group, with parameter values, optional excluded scopes and a non-compliance message. New and updated resources are evaluated immediately; existing resources are evaluated in a compliance scan about every 24 hours or on demand. Deny does not affect existing resources, so they appear as non-compliant. Modify and DeployIfNotExists assignments need a managed identity and a remediation task to fix existing resources. Exemptions waive or mitigate a specific resource or scope with an expiry date.