Interview Prep/Azure/Policy, Cost, AWS Mapping and Rapid-fire

How do remediation tasks and policy exemptions work?

AdvancedConceptPolicy, Cost, AWS Mapping and Rapid-fire
Answer

DeployIfNotExists and Modify only act on new or updated resources. For existing ones, create a remediation task, which runs as the assignment's managed identity (it needs the roles listed in the policy's roleDefinitionIds):

az policy remediation create -n fix-diag --policy-assignment diag-to-law \
  --resource-discovery-mode ReEvaluateCompliance

Exemptions (Waiver or Mitigated categories, optional expiry) exclude a specific scope from an assignment with a documented reason, which beats creating one-off assignments with exclusions. Trigger a compliance scan with az policy state trigger-scan -g rg.

Azure All Azure questions

More on Policy, Cost, AWS Mapping and Rapid-fire