MICROSOFT AZ-104 GOVERNANCE GUIDE

Azure Policy effects and remediation tasks

Choose the right policy response, understand what happens to existing resources, and diagnose the identity and permission path used during remediation.

Updated 18 August 2026 · Original ITCertPath learning resource

Start with four separate Azure Policy objects and actions

Definition

Contains the condition and effect: what state to evaluate and how Azure should respond.

Assignment

Applies a definition or initiative at a management-group, subscription, resource-group or resource scope.

Evaluation

Determines applicability and compliance for resources under the effective assignment scope.

Remediation

Runs modify operations or a deployIfNotExists template against eligible existing resources.

AZ-104 decision rule

Observe: audit. Block: deny. Adjust supported properties: modify. Deploy related configuration: deployIfNotExists. Correct existing resources: create a remediation task for modify or deployIfNotExists.

A policy assignment establishes the rule at scope; it is not the same thing as a remediation task. Evaluation can report a resource as noncompliant without changing it. A remediation task is the separately tracked operation that attempts corrective work on eligible existing resources.

Compare Azure Policy effects by desired outcome

EffectPrimary resultKey operational point
AuditRecord noncomplianceDoes not block or correct the request
AuditIfNotExistsCheck for required related configurationReports when the required related resource or setting is absent
DenyReject a noncompliant create or updateUse after validating scope and impact
DenyActionBlock supported resource actionsTargets action requests rather than only resulting resource properties
AppendAdd supported fields during request processingUseful only where the targeted alias and request behavior are compatible
ModifyAdd, replace or remove supported tags or propertiesExisting resources can require a remediation task
DeployIfNotExistsDeploy required related configurationUses an embedded ARM deployment and assignment identity
DisabledEvaluate no effectUseful as an effect parameter or temporary off state

Choose an effect from the requirement, not from the word “compliance” alone. “Report missing diagnostic settings” points to AuditIfNotExists. “Install diagnostic settings when absent” points to DeployIfNotExists. “Reject a resource outside approved regions” points to Deny.

New and updated resources behave differently from existing resources

Policy participates when applicable resources are created or updated, when assignments change, and during periodic or requested compliance evaluation. This timing matters:

  • New or updated request: an applicable deny effect can reject it; modify can alter supported request properties; deployIfNotExists can initiate related deployment after its conditions are evaluated.
  • Existing resource: evaluation can mark the resource noncompliant, but evaluation alone is not a bulk correction operation.
  • Existing resource under modify or deployIfNotExists: create a remediation task to attempt the defined corrective action.
  • Audit or deny finding: there is no generic remediation task that invents a correction. Fix the resource through an approved operational change or use a suitable corrective definition.

Remediation eligibility depends on compliance data. A task can use existing noncompliance results or request re-evaluation, depending on how it is created and configured. Track the task separately from the assignment and review per-resource deployments or failures.

Managed identity and RBAC: who performs the correction?

Azure Policy evaluation does not use the assignment identity simply to decide whether a resource matches a rule. The identity becomes essential when modify or deployIfNotExists must change resources. Each assignment can have one system-assigned or user-assigned managed identity, and that identity can receive multiple role assignments.

  1. The policy definition identifies required roles through full resource IDs in roleDefinitionIds.
  2. The policy assignment is associated with a managed identity.
  3. The identity receives the minimum Azure RBAC roles needed at every target scope used by the correction.
  4. The remediation task uses that identity to run modify operations or the embedded deployment.

Portal versus automation: the Azure portal can grant the definition's listed roles when the assignment is created. Assignments created through SDKs or other automation can require those role assignments to be added explicitly. Editing roleDefinitionIds later does not automatically refresh the identity's permissions.

A user may have permission to create a remediation task while the assignment identity lacks permission to change the resource. In that case task creation can succeed but individual remediation deployments fail. Always troubleshoot the executing identity, not only the administrator who started the task.

Worked scenarios: tags and diagnostic settings

Scenario 1: inherit an Environment tag

A subscription requires resources to inherit an Environment tag from their resource group. An audit policy would only report missing tags. A modify policy can add the supported tag during applicable create or update requests.

  1. Assign the modify definition at the intended scope with clear exclusions.
  2. Attach a managed identity and grant only the role required to change tags.
  3. Evaluate compliance to discover older resources without the tag.
  4. Create a remediation task for those existing noncompliant resources.
  5. Review task results and confirm the tag source and value before expanding scope.

Exam clue: “existing resources remain noncompliant after assigning a modify policy” points to remediation plus identity permissions, not a broader user role.

Scenario 2: deploy diagnostic settings

A security standard requires supported resources to send platform logs to a Log Analytics workspace. AuditIfNotExists can report missing settings. DeployIfNotExists can deploy the related diagnostic-settings resource when the existence condition is not satisfied.

  1. Verify the definition's existence condition and embedded deployment target the correct resource type.
  2. Ensure the assignment identity can create diagnostic settings and access any referenced cross-scope destination as required.
  3. Use audit-oriented validation before enforcing or remediating widely.
  4. Run a remediation task for already-deployed resources and inspect the underlying deployment errors.

Exam clue: when the requirement says “create a related resource if missing,” deployIfNotExists is usually a closer fit than modify.

A safe Azure Policy rollout workflow

  1. Translate the requirement: define the exact noncompliant state, target resource types and desired response.
  2. Prefer a built-in definition when suitable: inspect its version, parameters, effect and required roles.
  3. Start with visibility: Microsoft recommends beginning with audit or auditIfNotExists to measure impact before enforcement.
  4. Set assignment scope carefully: account for inheritance, not-scopes and approved exemptions.
  5. Configure identity and least-privilege roles: check every scope touched by modify operations or the deployment template.
  6. Evaluate and sample results: investigate false positives, unsupported aliases and automation conflicts.
  7. Create a bounded remediation task: filter scope or location where appropriate and control parallelism for large estates.
  8. Monitor deployments: review successful, failed and skipped resources instead of relying only on the assignment's aggregate state.
  9. Move to enforcement deliberately: document rollback, exemption ownership and change review.

Troubleshoot remediation failures by layer

SymptomLikely layerWhat to verify
AuthorizationFailed in task deploymentManaged identity / RBACPrincipal ID, roleDefinitionIds, role assignment and target scope
No resources selectedCompliance / scopeAssignment scope, exclusions, exemptions, applicability and latest evaluation
Property was not modifiedDefinition / aliasSupported modify alias, operation, resource API behavior and conflict handling
Related deployment failsARM template / providerTemplate parameters, resource type, destination access, dependency and provider error
ScopeLockedResource lockDirect and inherited locks on every resource touched
Remediated resource later returns to noncomplianceOperations / ownershipConfiguration drift, competing automation, policy version and assignment parameters

Open the remediation task, inspect the affected resource, and follow the related deployment or event. Do not “fix” authorization failures by granting Owner unless that breadth is genuinely required; determine the exact write or deployment permissions instead.

AZ-104 practice checks with explanations

A policy must report unapproved VM sizes without blocking deployment. Which effect?

Best answer: Audit. It records noncompliance while allowing the request, which is also useful during impact assessment.

A tag modify policy is assigned, but hundreds of old resources remain unchanged. What next?

Best answer: confirm compliance evaluation, create a remediation task, and verify the assignment identity has the RBAC permissions required to update the supported tag.

A task was created by an Owner but its deployments return AuthorizationFailed. Why?

Best answer: remediation runs as the policy assignment's managed identity. The initiating user's Owner role does not become the task's execution identity.

A required diagnostic-settings resource must be created when missing. Which effect best fits?

Best answer: DeployIfNotExists, because the requirement is to deploy related configuration after the existence condition is not satisfied.

Common AZ-104 mistakes

  • Confusing policy assignment with remediation execution.
  • Expecting audit or deny to repair existing resources automatically.
  • Assuming assignment identity is used for ordinary policy evaluation.
  • Checking the operator's role instead of the remediation identity's role.
  • Using Contributor everywhere instead of granting the smallest required permissions.
  • Forgetting that cross-scope destinations can require additional authorization.
  • Skipping audit-first validation and applying deny at a broad inherited scope.
  • Changing a definition's required roles without updating the identity's role assignments.

Frequently asked questions

Which Azure Policy effects support remediation tasks?

Remediation tasks bring existing noncompliant resources toward compliance for policy assignments that use modify or deployIfNotExists. The task runs the definition's modify operations or embedded deployment against selected eligible resources.

Why does Azure Policy remediation need a managed identity?

Azure Policy needs an authorized identity when it changes a resource or creates related configuration. A modify or deployIfNotExists assignment can use one system-assigned or user-assigned managed identity, which must have the least-privilege Azure RBAC roles required by the definition.

Does assigning a modify policy immediately fix existing resources?

Not by assignment alone. Applicable new or updated requests can be modified during policy processing, while existing noncompliant resources normally require a remediation task. Compliance evaluation must also identify eligible resources.

Why does an Azure Policy remediation task fail?

Common causes include missing RBAC permissions for the assignment identity, an incorrect roleDefinitionIds entry, scope mismatch, a template or alias problem, resource locks, conflicting policy, unsupported modification, or a resource-provider deployment failure.

Official Microsoft references

Verify current service behavior, built-in definition versions and assignment scope before changing production governance. ITCertPath uses original learning scenarios and does not reproduce confidential exam questions.