Home › Studies › AZ-305 › Identity & Governance › Azure Policy & Compliance

Azure Policy & Compliance

Effects · Initiatives · Remediation · Exemptions · Compliance

Practice questions for this topic →

Effects

EffectDoesNeeds managed identity?
denyBlocks non-compliant create or updateNo
auditLogs non-compliance of the resource itselfNo
auditIfNotExistsAudits when a related resource is missing (for example no diagnostic setting or extension)No
deployIfNotExistsDeploys the missing related resource (nested templates only, not linked templates)Yes
modifyAdds or replaces properties or tags on create or updateYes
appendAdds fields on create or update (prefer modify for tags)No
denyActionBlocks an action (delete is the only one) on matching resourcesNo
disabledTurns the policy offNo

Order of evaluation: disabled → append/modify → deny → audit → manual → auditIfNotExists → denyAction. Existing resources are fixed only by a remediation task. deployIfNotExists runs after a delay once the resource provider returns success.

denyAction in detail

Constructs

ConstructUse for
Initiative (policy set)Group many policies, for example a regulatory standard
Assignment scopeManagement group, subscription or resource group, with exclusions
ExemptionWaive or mitigate a specific resource or scope, optional expiry
Remediation taskApply modify or deployIfNotExists to existing resources
Machine configurationAudit and configure settings inside VMs and Arc servers

Exam Tips

Tick each tip once you can answer it without looking.

“Only allow resources in East US and West US” → Built-in 'Allowed locations' with deny.

“Only allow specific VM SKUs” → 'Allowed virtual machine size SKUs' (deny).

“Automatically configure diagnostic settings on new resources” → deployIfNotExists (+ managed identity).

“Existing non-compliant resources must be fixed” → Remediation task. Trap: New assignments don't change existing resources automatically.

“Report non-compliance without blocking anyone” → audit / auditIfNotExists.

“Prevent deletion of production databases even by Owners, via policy” → denyAction (delete).

“Policy vs RBAC” → Policy controls WHAT; RBAC controls WHO.

“Apply many related policies for ISO 27001 as one unit” → Initiative.

“One resource legitimately can't comply; keep it compliant in reports” → Policy exemption (waiver/mitigated).

“Audit OS settings inside VMs (e.g. password policy)” → Azure Machine Configuration (guest configuration).

“Resource types exempt from denyAction” → Policy assignments, deny assignments, blueprint assignments, deployment stacks, subscriptions and locks. Trap: This prevents lockout of governance itself.

“denyAction and resource group deletion” → Blocks it only when the policy sets cascadeBehaviors to deny and the resource supports location and tags. Trap: Subscription deletion isn't blocked; delete is the only supported action.

“Azure Policy order of evaluation (Resource Manager mode)” → disabled, then append and modify, deny, audit, manual, auditIfNotExists, with denyAction last. Trap: Append and modify run before deny, so a change they make can stop deny from triggering.

“Match the policy effect to its evaluation rule” → disabled checked first; append and modify before deny; deny before audit; auditIfNotExists assesses a child or extension resource; denyAction last. Trap: Append and modify can stop deny from triggering.

Sources

← Hierarchy, Tags & LocksIdentity Governance →