Enforcing Standards with Azure Policy Effects
This lesson explains policy definitions, assignments and effects.
Learning outcomes
After completing this lesson, you will be able to:
- Describe definitions, initiatives and assignments.
- Choose a policy effect for a requirement.
- Distinguish Azure Policy, RBAC, resource locks and deployment stacks.
How Azure Policy works
Azure Policy evaluates resources against rules at the time of deployment and on a regular cycle afterwards. A policy definition describes a condition and an effect. An initiative groups definitions so that they can be assigned and tracked as one unit. An assignment applies a definition or initiative at a scope, with optional exclusions, and exemptions can cover specific resources with a reason and expiry date.
Azure Policy controls the properties of resources, not the people who deploy them. RBAC can say that a user may create storage accounts; Azure Policy can say that a storage account must disable public access, whoever creates it.
Policy effects
The effect is what happens when a resource matches a rule. Selecting the right effect is a frequent exam task.
- Deny rejects a request that would create a non-compliant resource.
- Audit allows the request but records the resource as non-compliant.
- Modify adds, changes or removes properties or tags on a resource at request time, and can remediate existing resources.
- Append adds fields to a resource at creation, in simpler cases.
- DeployIfNotExists deploys a related resource if it is missing, such as a diagnostic setting. It needs a managed identity to act, and remediation tasks cover existing resources.
- AuditIfNotExists reports when a related resource is missing, without creating it.
- DenyAction blocks specific actions, such as deletion, on matching resources.
A policy is not retroactive with a deny effect. Existing resources that break a new rule stay in place and are reported as non-compliant, and remediation is limited to the modify and deployIfNotExists effects.
The following diagram matches each security requirement to an Azure Policy effect.

Policy effects
Separating similar controls
Governance scenarios often offer several tools that all seem to help. The following comparison shows how they differ.
Policy, RBAC, lock or stack?
Rolling out policy safely
A policy with a deny effect can break deployment pipelines if it is introduced suddenly. A safe rollout uses enforcement mode set to disabled, or an audit effect, to learn what would be affected, and then enforces the rule after teams have addressed the findings. Microsoft also supports safe deployment practices, in which assignments move in rings, from a small scope to a larger one.
Assignments can also be managed as code, and many organizations use the Enterprise Policy as Code approach or the built-in landing zone policies. Exemptions should be recorded and given an expiry date, since permanent exclusions gradually weaken governance.
A safe policy rollout
Choosing the effect
A security team requires the following. New storage accounts must never permit public blob access. Every Azure SQL server, existing or new, must send audit logs to a central workspace. A report must show which virtual machines lack a backup, with no automatic change. Which effect suits each requirement?
New storage accounts must never be non-compliant, so deny applies. SQL audit logging requires a related resource to be created on new and existing servers, so deployIfNotExists applies, with a remediation task for existing servers and a managed identity on the assignment.
The backup report needs no change, and concerns a related resource, so auditIfNotExists applies. Using deny for backups would block virtual machine creation rather than report on gaps, and a plain audit effect on the virtual machine could not examine whether the related protection item exists.
A new deny policy is assigned. What happens to existing non-compliant resources?
Show answer
They remain in place and are reported as non-compliant. Deny affects new requests, and only modify and deployIfNotExists can remediate.
Exam Tips
Remember for the exam
- An initiative groups definitions; an assignment applies them at a scope.
- Deny blocks; audit reports; modify changes; deployIfNotExists creates related resources.
- Only modify and deployIfNotExists can remediate existing resources.
- Introduce deny policies through audit or disabled enforcement first.