You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/governance/policy/concepts/effects.md
+18-19Lines changed: 18 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: Understand how effects work
3
3
description: Azure Policy definitions have various effects that determine how compliance is managed and reported.
4
4
author: timwarner-msft
5
-
ms.date: 10/20/2022
5
+
ms.date: 02/22/2023
6
6
ms.topic: conceptual
7
7
ms.author: timwarner
8
8
---
@@ -51,10 +51,10 @@ manages the evaluation and outcome and reports the results back to Azure Policy.
51
51
Resource Manager mode.
52
52
-**Deny** is then evaluated. By evaluating deny before audit, double logging of an undesired
53
53
resource is prevented.
54
-
-**Audit** is evaluated.
55
-
-**Manual** is evaluated.
56
-
-**AuditIfNotExists** is evaluated.
57
-
-**denyAction** is evaluated last.
54
+
-**Audit** is evaluated.
55
+
-**Manual** is evaluated.
56
+
-**AuditIfNotExists** is evaluated.
57
+
-**denyAction** is evaluated last.
58
58
59
59
After the Resource Provider returns a success code on a Resource Manager mode request,
60
60
**AuditIfNotExists** and **DeployIfNotExists** evaluate to determine whether additional compliance
@@ -460,21 +460,21 @@ location of the Constraint template to use in Kubernetes to limit the allowed co
460
460
### DenyAction evaluation
461
461
462
462
When a request call with an applicable action name and targeted scope is submitted, `denyAction` prevents the request from succeeding. The request is returned as a `403 (Forbidden)`. In the portal, the Forbidden can be viewed as a status on the deployment that was prevented by the policy
463
-
assignment.
463
+
assignment.
464
464
465
-
`Microsoft.Authorization/policyAssignments`, `Microsoft.Authorization/denyAssignments`, `Microsoft.Blueprint/blueprintAssignments`, `Microsoft.Resources/deploymentStacks`, and `Microsoft.Authorization/locks` are all exempt from DenyAction enforcement to prevent lockout scenarios.
465
+
`Microsoft.Authorization/policyAssignments`, `Microsoft.Authorization/denyAssignments`, `Microsoft.Blueprint/blueprintAssignments`, `Microsoft.Resources/deploymentStacks`, and `Microsoft.Authorization/locks` are all exempt from DenyAction enforcement to prevent lockout scenarios.
466
466
467
467
> [!NOTE]
468
468
> Under preview, assignments with `denyAction` effect will show a `Not Started` compliance state.
469
469
470
470
#### Subscription deletion
471
-
Policy won't block removal of resources that happens during a subscription deletion.
471
+
Policy won't block removal of resources that happens during a subscription deletion.
472
472
473
-
#### Resource group deletion
474
-
Policy will evaluate resources that support location and tags against `DenyAction` policies during a resource group deletion. Only policies that have the `cascadeBehaviors` set to `deny` in the policy rule will block a resource group deletion. Policy won't block removal of resources that don't support location and tags nor any policy with `mode:all`.
473
+
#### Resource group deletion
474
+
Policy will evaluate resources that support location and tags against `DenyAction` policies during a resource group deletion. Only policies that have the `cascadeBehaviors` set to `deny` in the policy rule will block a resource group deletion. Policy won't block removal of resources that don't support location and tags nor any policy with `mode:all`.
475
475
476
476
#### Cascade deletion
477
-
Cascade deletion occurs when deleting of a parent resource is implicitly deletes all its child resources. Policy won't block removal of child resources when a delete action targets the parent resources. For example, `Microsoft.Insights/diagnosticSettings` is a child resource of `Microsoft.Storage/storageaccounts`. If a `denyAction` policy targets `Microsoft.Insights/diagnosticSettings`, a delete call to the diagnostic setting (child) will fail, but a delete to the storage account (parent) will implicitly delete the diagnostic setting (child).
477
+
Cascade deletion occurs when deleting of a parent resource is implicitly deletes all its child resources. Policy won't block removal of child resources when a delete action targets the parent resources. For example, `Microsoft.Insights/diagnosticSettings` is a child resource of `Microsoft.Storage/storageaccounts`. If a `denyAction` policy targets `Microsoft.Insights/diagnosticSettings`, a delete call to the diagnostic setting (child) will fail, but a delete to the storage account (parent) will implicitly delete the diagnostic setting (child).
@@ -483,16 +483,16 @@ Cascade deletion occurs when deleting of a parent resource is implicitly deletes
483
483
The **details** property of the DenyAction effect has all the subproperties that define the action and behaviors.
484
484
485
485
-**actionNames** (required)
486
-
- An _array_ that specifies what actions to prevent from being executed.
487
-
- Supported action names are: `delete`.
486
+
- An _array_ that specifies what actions to prevent from being executed.
487
+
- Supported action names are: `delete`.
488
488
-**cascadeBehaviors** (optional)
489
-
- An _object_ that defines what behavior will be followed when the resource is being implicitly deleted by the removal of a resource group.
489
+
- An _object_ that defines what behavior will be followed when the resource is being implicitly deleted by the removal of a resource group.
490
490
- Only supported in policy definitions with [mode](./definition-structure.md#resource-manager-modes) set to `indexed`.
491
-
- Allowed values are `allow` or `deny`.
492
-
- Default value is `deny`.
491
+
- Allowed values are `allow` or `deny`.
492
+
- Default value is `deny`.
493
493
494
494
### DenyAction example
495
-
Example: Deny any delete calls targeting database accounts that have a tag environment that equals prod. Since cascade behavior is set to deny, block any DELETE call that targets a resource group with an applicable database account.
495
+
Example: Deny any delete calls targeting database accounts that have a tag environment that equals prod. Since cascade behavior is set to deny, block any DELETE call that targets a resource group with an applicable database account.
496
496
497
497
```json
498
498
{
@@ -565,8 +565,7 @@ related resources to match and the template deployment to execute.
565
565
- Allowed values are _Subscription_ and _ResourceGroup_.
566
566
- Sets the scope of where to fetch the related resource to match from.
567
567
- Doesn't apply if **type** is a resource that would be underneath the **if** condition resource.
568
-
- For _ResourceGroup_, would limit to the **if** condition resource's resource group or the
569
-
resource group specified in **ResourceGroupName**.
568
+
- For _ResourceGroup_, would limit to the resource group in **ResourceGroupName** if specified. If **ResourceGroupName** isn't specified, would limit to the **if** condition resource's resource group, which is the default behavior.
570
569
- For _Subscription_, queries the entire subscription for the related resource. Assignment scope should be set at subscription or higher for proper evaluation.
0 commit comments