D1 · Identity, Governance & Monitoring

Designing with Azure Policy

is the CAF's policy-driven governance mechanism: it turns business rules ("only European regions", "every resource must have a cost center tag", "disks must always be encrypted") into automatic guardrails. AZ-305 tests whether you pick the correct effect and the correct scope for each requirement.

Icon-manage-316

Policy vs RBAC vs Locks — who does what

MechanismControlsQuestion it answers
WHO can perform WHAT actionsCan this user create VMs in this resource group?
Azure PolicyWHAT properties resources can haveCan this VM be a GS5 series? Can it live outside West Europe?
Resource LocksProtection against deletion/modificationCan anyone (even an Owner) delete this resource?

Design key

Policy and RBAC are complementary and independent: even with the Owner role, a deny policy still blocks you. Policy is evaluated at the control plane (ARM) — it doesn't inspect the data plane (with exceptions like Key Vault and Kubernetes policies).

Icon-manage-316

Azure Policy effects

EffectWhat it doesTypical scenario
DenyRejects the create/update that violates the ruleBlock disallowed regions, expensive SKUs, public IPs
AuditAllows it but flags it as non-compliantEvaluation phase before hardening; visibility without breaking things
AuditIfNotExistsAudits if a related resource is missingVMs without the monitoring extension installed
DeployIfNotExists (DINE)Automatically deploys the missing resource (remediation)Install the Azure Monitor Agent (AMA), enable diagnostic settings
ModifyAlters properties/tags on creation or remediationAdd/inherit tags, enable properties (HTTPS only)
AppendAdds fields to the request (legacy, prefer Modify)Add IP rules to storage accounts
DisabledDisables the rule without removing the assignmentTemporarily pause a policy

Important for the exam

  • • Deny policies do NOT affect existing resources — they only block new creations/updates. Existing resources become non-compliant
  • • To fix what already exists: remediation tasks (DINE and Modify only)
  • • Exemptions documented with an expiration for legitimate exceptions

Assignment scope

  • • Management group → all child subscriptions (typical in landing zones)
  • • Subscription or resource group for specific rules
  • • notScopes to exclude specific scopes from a broad assignment
Icon-manage-316

Initiatives (policy sets) and compliance

An groups multiple policy definitions under a single assignment with shared parameters. Recommended design: assign initiatives, not individual policies — it simplifies management and aggregate compliance reporting.

Key built-in initiatives

  • • Microsoft Cloud Security Benchmark — Defender for Cloud's security baseline
  • • Regulatory initiatives: ISO 27001, PCI DSS, NIST, GDPR — map controls to auditable policies
  • • If the scenario asks to "evaluate compliance with ISO 27001" → assign the corresponding regulatory compliance initiative

Compliance evaluation

  • • Compliance dashboard per assignment, with drill-down per resource
  • • Evaluation: on resource create/update, every ~24h, or on demand
  • • Results feed into Defender for Cloud (Secure Score and regulatory compliance)

Remediation and managed identities

How a remediation task works

1The DINE/Modify assignment receives a
2That identity is granted the RBAC roles it needs (e.g. Contributor over the scope)
3The remediation task walks through the existing non-compliant resources
4It runs the deployment or modify on each one until they become compliant

Exam trap

"Existing VMs don't have the monitoring agent and a deny policy doesn't fix it" — correct, deny only prevents. To install the agent on existing resources you need a DeployIfNotExists policy + a remediation task with a managed identity.

Decision table

RequirementEffect / design
Prevent creating resources outside West Europe / North EuropeDeny (allowed locations) at management group
Find out which storage accounts allow public access, without breaking anythingAudit
Automatically install the AMA agent on new and existing VMsDeployIfNotExists + remediation task
Inherit the CostCenter tag from the resource group to every resourceModify + remediation task
Require the Environment tag when creating any resourceDeny if the tag is missing
Demonstrate PCI DSS compliancePCI DSS regulatory compliance initiative
Temporarily exempt a subscription from a policyPolicy exemption with an expiration date
Limit VMs to approved SKUs to control costsDeny (allowed SKUs)

Did you get this topic?

Test what you just learned

A company requires all VMs (new and existing, across 30 subscriptions) to have the Azure Monitor Agent extension installed. The governance team wants minimal manual effort. What do you design?

Ready to test "Designing with Azure Policy"?

Put what you learned to the test with original AZ-305 exam questions.

Start AZ-305 mock exam

Unlimited mock exams with the Pro plan

Log in to track your progress.