You plan to assign a built-in policy with a Deny effect to a management group that contains production subscriptions. Before you enforce it, you must meet these requirements:
- Evaluate every existing production resource to which the policy applies and view its compliance results.
- Do not block any deployments during the test.
- Do not modify the built-in policy definition, which other teams also use.
- Do not generate Azure Activity log entries from the policy effect during the test.
- Enable enforcement later without creating a new assignment.
What should you do?
Disabling enforcement on an assignment supports testing while Azure Policy continues to evaluate applicable resources and report compliance. The deny effect is not applied, and the policy effect does not trigger Activity log entries. This differs from the disabled effect, which stops evaluation completely. Enforcement can later be enabled on the same assignment without changing the built-in definition.
- Not correct: Create the assignment, and create a policy exemption for each production subscription. Exempted resources are not assessed against the policy's requirements and appear as Exempted, so you would not see the required test results.
- Not correct: Create the assignment, and add each production subscription to its notScopes property. Resources in excluded scopes are not evaluated or counted for compliance, so you cannot test the policy against them.
- Not correct: Change the effect in the policy definition to disabled. The disabled effect prevents policy evaluation, so it would not provide the required compliance results.
- Correct: Create the assignment with enforcement disabled, and enable enforcement on it later. Disabling policy enforcement allows compliance evaluation without applying the deny effect or triggering Activity log entries from that effect. Enforcement can be enabled on the same assignment later.
- Azure Policy initiatives: Evaluation of resources through Azure PolicyMicrosoft Learn
- Azure Policy initiatives: Azure Policy resourcesMicrosoft Learn