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
+19-22Lines changed: 19 additions & 22 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: 01/06/2023
6
6
ms.topic: conceptual
7
7
ms.author: timwarner
8
8
---
@@ -18,7 +18,7 @@ These effects are currently supported in a policy definition:
18
18
-[Audit](#audit)
19
19
-[AuditIfNotExists](#auditifnotexists)
20
20
-[Deny](#deny)
21
-
-[DenyAction (preview)](#denyaction-preview)
21
+
-[DenyAction](#denyaction)
22
22
-[DeployIfNotExists](#deployifnotexists)
23
23
-[Disabled](#disabled)
24
24
-[Manual (preview)](#manual-preview)
@@ -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
@@ -453,28 +453,25 @@ location of the Constraint template to use in Kubernetes to limit the allowed co
453
453
}
454
454
}
455
455
```
456
-
## DenyAction (preview)
456
+
## DenyAction
457
457
458
458
`DenyAction` is used to block requests on intended action to resources. The only supported action today is `DELETE`. This effect will help prevent any accidental deletion of critical resources.
459
459
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.
466
-
467
-
> [!NOTE]
468
-
> Under preview, assignments with `denyAction` effect will show a `Not Started` compliance state.
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.
469
466
470
467
#### Subscription deletion
471
-
Policy won't block removal of resources that happens during a subscription deletion.
468
+
Policy won't block removal of resources that happens during a subscription deletion.
472
469
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`.
470
+
#### Resource group deletion
471
+
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
472
476
473
#### 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).
474
+
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 +480,16 @@ Cascade deletion occurs when deleting of a parent resource is implicitly deletes
483
480
The **details** property of the DenyAction effect has all the subproperties that define the action and behaviors.
484
481
485
482
-**actionNames** (required)
486
-
- An _array_ that specifies what actions to prevent from being executed.
487
-
- Supported action names are: `delete`.
483
+
- An _array_ that specifies what actions to prevent from being executed.
484
+
- Supported action names are: `delete`.
488
485
-**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.
486
+
- An _object_ that defines what behavior will be followed when the resource is being implicitly deleted by the removal of a resource group.
490
487
- 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`.
488
+
- Allowed values are `allow` or `deny`.
489
+
- Default value is `deny`.
493
490
494
491
### 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.
492
+
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.
Copy file name to clipboardExpand all lines: articles/governance/policy/concepts/evaluate-impact.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ reviews the request. When the policy definition effect is [Modify](./effects.md#
12
12
[Append](./effects.md#deny), or [DeployIfNotExists](./effects.md#deployifnotexists), Policy alters
13
13
the request or adds to it. When the policy definition effect is [Audit](./effects.md#audit) or
14
14
[AuditIfNotExists](./effects.md#auditifnotexists), Policy causes an Activity log entry to be created
15
-
for new and updated resources. And when the policy definition effect is [Deny](./effects.md#deny) or [DenyAction](./effects.md#denyaction-preview), Policy stops the creation or alteration of the request.
15
+
for new and updated resources. And when the policy definition effect is [Deny](./effects.md#deny) or [DenyAction](./effects.md#denyaction), Policy stops the creation or alteration of the request.
16
16
17
17
These outcomes are exactly as desired when you know the policy is defined correctly. However, it's
18
18
important to validate a new policy works as intended before allowing it to change or block work. The
0 commit comments