A Modify policy adds CostCenter=042 to resources in RG-Finance. New resources are tagged correctly, but existing virtual machines remain untagged. What three requirements must be met for the assignment to update the existing resources? Select three.
Trap 1: Recreate the virtual machines before the policy can evaluate them.
There is no need to recreate or redeploy the virtual machines because Azure Policy's Modify effect, combined with a remediation task, is designed to update existing resources in place without downtime. Recreating a VM may also fail to add the desired tag unless your deployment template explicitly includes the tag, and the new VM would still be evaluated from scratch. Policy evaluation is continuous and covers all resources, regardless of whether they were created before or after the assignment, so recreation is an unnecessary and ineffective workaround.
Trap 2: Change the effect from Modify to Audit to trigger the tag operation.
Changing the effect to Audit is logically incorrect because Audit does not perform any write operation—it only compares the resource's current tags against the policy rule and generates a compliance result. If you switch from Modify to Audit, Azure Policy will report the resources as non-compliant but will never attempt to add the costcenter tag. This would solve the original problem (applying the tag) by removing the mechanism that could apply it, making the situation worse.
- A
Create a remediation task for the policy assignment.
A Modify policy assignment only makes the effect available to the Azure Policy engine; it does not automatically update already-provisioned resources. Existing virtual machines in the finance resource group remain non-compliant until you trigger a remediation task, which asynchronously invokes the resource provider to write the costcenter=042 tag. You can run the task on demand or schedule it, and it will report the number of resources successfully remediated versus those that failed.
- B
Ensure the policy assignment has a managed identity.
The Modify effect must execute an ARM (Azure Resource Manager) write operation against the target resources, so the policy assignment requires a managed identity to authenticate those calls. Without an assigned identity, the policy can evaluate and report non-compliance but has no principal under which to issue a PATCH request to apply the tag. You enable this identity when creating the assignment, choosing either a system-assigned or user-assigned managed identity.
- C
Grant that identity permission to update the target resources or tags at the assigned scope.
Even with a valid managed identity, the Azure Policy runtime will receive an authorization failure unless that identity has RBAC permissions on the scope—at minimum a role such as Tag Contributor (which grants Microsoft.Resources/tags/write) or Contributor. Apply the role to the identity on the resource group, not to individual VMs, so the remediation task can modify every resource within the assigned scope. A common error is configuring the identity but forgetting to assign the role, which makes remediation tasks fail with a 403 status.
- D
Recreate the virtual machines before the policy can evaluate them.
Why wrong: There is no need to recreate or redeploy the virtual machines because Azure Policy's Modify effect, combined with a remediation task, is designed to update existing resources in place without downtime. Recreating a VM may also fail to add the desired tag unless your deployment template explicitly includes the tag, and the new VM would still be evaluated from scratch. Policy evaluation is continuous and covers all resources, regardless of whether they were created before or after the assignment, so recreation is an unnecessary and ineffective workaround.
- E
Change the effect from Modify to Audit to trigger the tag operation.
Why wrong: Changing the effect to Audit is logically incorrect because Audit does not perform any write operation—it only compares the resource's current tags against the policy rule and generates a compliance result. If you switch from Modify to Audit, Azure Policy will report the resources as non-compliant but will never attempt to add the costcenter tag. This would solve the original problem (applying the tag) by removing the mechanism that could apply it, making the situation worse.