Skip to content

Commit b6018be

Browse files
Merge pull request #278704 from mumian/0619-stack-denysetting
Additional information for DenySettingsApplyToChildScopes
2 parents 336428e + 71a3254 commit b6018be

File tree

3 files changed

+23
-17
lines changed

3 files changed

+23
-17
lines changed

articles/azure-resource-manager/bicep/deployment-stacks.md

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Create & deploy deployment stacks in Bicep
33
description: Describes how to create deployment stacks in Bicep.
44
ms.topic: how-to
55
ms.custom: devx-track-azurecli, devx-track-azurepowershell, devx-track-bicep
6-
ms.date: 05/31/2024
6+
ms.date: 06/19/2024
77
---
88

99
# Deployment stacks
@@ -25,13 +25,13 @@ To create your first deployment stack, work through [Quickstart: create deployme
2525
Deployment stacks provide the following benefits:
2626

2727
- Streamlined provisioning and management of resources across different scopes as a unified entity.
28-
- Prevention of undesired modifications to managed resources via [deny settings](#protect-managed-resources-against-deletion).
28+
- Prevention of undesired modifications to managed resources via [deny settings](#protect-managed-resources).
2929
- Efficient environment cleanup using delete flags during deployment stack updates.
3030
- Use of standard templates such as Bicep, ARM templates, or Template specs for your deployment stacks.
3131

3232
### Known limitations
3333

34-
- Implicitly created resources aren't managed by the stack. Therefore, no deny-assignments or cleanup is possible.
34+
- Implicitly created resources aren't managed by deployment stack. Therefore, no [deny-assignments](../../role-based-access-control/deny-assignments.md) or cleanup is possible.
3535
- Deny-assignments don't support tags.
3636
- Deny-assignments aren't supported at the management group scope. However, they're supported in a management group stack if the deployment is pointed at the subscription scope.
3737
- Deployment stacks can't delete Key vault secrets. If you're removing key vault secrets from a template, make sure to also execute the deployment stack update/delete command with detach mode.
@@ -47,7 +47,7 @@ Deployment stacks provide the following benefits:
4747
## Built-in roles
4848

4949
> [!WARNING]
50-
> Enforcement of the RBAC permission [Microsoft.Resources/deploymentStacks/manageDenySetting/action](/azure/role-based-access-control/permissions/management-and-governance) is rolling out across regions, including Government Clouds.
50+
> Enforcement of the RBAC permission [Microsoft.Resources/deploymentStacks/manageDenySetting/action](/azure/role-based-access-control/permissions/management-and-governance) is rolling out across regions, including Government Clouds.
5151
5252
There are two built-in roles for deployment stack:
5353

@@ -62,7 +62,7 @@ A deployment stack resource can be created at resource group, subscription, or m
6262
- A stack at subscription scope can deploy the template passed-in to a resource group scope (if specified) or the same subscription scope where the deployment stack exists.
6363
- A stack at management group scope can deploy the template passed-in to the subscription scope specified.
6464

65-
It's important to note that where a deployment stack exists, so is the deny-assignment created with the deny settings capability. For example, by creating a deployment stack at subscription scope that deploys the template to resource group scope and with deny settings mode `DenyDelete`, you can easily provision managed resources to the specified resource group and block delete attempts to those resources. By using this approach, you also enhance the security of the deployment stack by separating it at the subscription level, as opposed to the resource group level. This separation ensures that the developer teams working with the provisioned resources only have visibility and write access to the resource groups, while the deployment stack remains isolated at a higher level. This minimizes the number of users that can edit a deployment stack and make changes to its deny-assignment. For more information, see [Protect managed resource against deletion](#protect-managed-resources-against-deletion).
65+
It's important to note that where a deployment stack exists, so is the deny-assignment created with the deny settings capability. For example, by creating a deployment stack at subscription scope that deploys the template to resource group scope and with deny settings mode `DenyDelete`, you can easily provision managed resources to the specified resource group and block delete attempts to those resources. By using this approach, you also enhance the security of the deployment stack by separating it at the subscription level, as opposed to the resource group level. This separation ensures that the developer teams working with the provisioned resources only have visibility and write access to the resource groups, while the deployment stack remains isolated at a higher level. This minimizes the number of users that can edit a deployment stack and make changes to its deny-assignment. For more information, see [Protect managed resource against deletion](#protect-managed-resources).
6666

6767
The create-stack commands can also be used to [update deployment stacks](#update-deployment-stacks).
6868

@@ -664,24 +664,29 @@ To add a managed resource, add the resource definition to the underlying Bicep f
664664

665665
To delete a managed resource, remove the resource definition from the underlying Bicep files, and then run the update command or rerun the create command. For more information, see [Update deployment stacks](#update-deployment-stacks).
666666

667-
## Protect managed resources against deletion
667+
## Protect managed resources
668668

669-
When creating a deployment stack, it's possible to assign a specific type of permissions to the managed resources, which prevents their deletion by unauthorized security principals. These settings are referred to as deny settings. You want to store the stack at a parent scope.
669+
You can assign specific permissions to the managed resources of a deployment stack to prevent unauthorized security principals from deleting or updating them. These permissions are referred to as deny settings. You want to store stacks at parent scope. For example, to protect resources in a subscription, you must place the stack at the parent scope, which is the immediate parent management group.
670+
671+
The deny setting only applies to the [control plane operations](../management/control-plane-and-data-plane.md#control-plane), not the [data plane operations](../management/control-plane-and-data-plane.md#data-plane). For example, storage accounts and key vaults are created through the control plane, allowing them to be managed by a deployment stack. However, child resources like secrets or blob containers, which are created through the data plane, cannot be managed by a deployment stack.
672+
673+
The deny setting only applies to explicitly created resources, not implicitly created ones. For example, a managed AKS cluster creates multiple other services to support it, such as a virtual machine. In this case, since the virtual machine is not defined in the Bicep file and is an implicitly created resource, it is not subject to the deployment stack deny settings.
670674

671675
> [!NOTE]
672676
> The latest release requires specific permissions at the stack scope in order to:
673677
>
674-
> - Create or update a deployment stack and set the deny setting to a value other than "None".
675-
> - Update or delete a deployment stack with an existing deny setting of something other than "None"
678+
> - Create or update a deployment stack and configure deny setting to a value other than `None`.
679+
> - Update or delete a deployment stack with an existing deny setting of a value other than `None`.
676680
>
677-
> Use the [built-in roles](#built-in-roles) to grant the permissions.
681+
> Use the deployment stack [built-in roles](#built-in-roles) to grant permissions.
678682
679683
# [PowerShell](#tab/azure-powershell)
680684

681685
The Azure PowerShell includes these parameters to customize the deny-assignment:
682686

683687
- `DenySettingsMode`: Defines the operations that are prohibited on the managed resources to safeguard against unauthorized security principals attempting to delete or update them. This restriction applies to everyone unless explicitly granted access. The values include: `None`, `DenyDelete`, and `DenyWriteAndDelete`.
684-
- `DenySettingsApplyToChildScopes`: Deny settings are applied to nested resources under managed resources.
688+
- `DenySettingsApplyToChildScopes`: When specified, the deny setting mode configuration also applies to the child scope of the managed resources. For example, a
689+
Bicep file defines a _Microsoft.Sql/servers_ resource (parent) and a _Microsoft.Sql/servers/databases_ resource (child). If a deployment stack is created using the Bicep file with the `DenySettingsApplyToChildScopes` setting enabled and the `DenySettingsMode` set to `DenyWriteAndDelete`, you can't add any additional child resources to either the _Microsoft.Sql/servers_ resource or the _Microsoft.Sql/servers/databases_ resource.
685690
- `DenySettingsExcludedAction`: List of role-based management operations that are excluded from the deny settings. Up to 200 actions are permitted.
686691
- `DenySettingsExcludedPrincipal`: List of Microsoft Entra principal IDs excluded from the lock. Up to five principals are permitted.
687692

@@ -690,7 +695,8 @@ The Azure PowerShell includes these parameters to customize the deny-assignment:
690695
The Azure CLI includes these parameters to customize the deny-assignment:
691696

692697
- `deny-settings-mode`: Defines the operations that are prohibited on the managed resources to safeguard against unauthorized security principals attempting to delete or update them. This restriction applies to everyone unless explicitly granted access. The values include: `none`, `denyDelete`, and `denyWriteAndDelete`.
693-
- `deny-settings-apply-to-child-scopes`: Deny settings are applied to nested resources under managed resources.
698+
- `deny-settings-apply-to-child-scopes`: When specified, the deny setting mode configuration also applies to the child scope of the managed resources. For example, a
699+
Bicep file defines a _Microsoft.Sql/servers_ resource (parent) and a _Microsoft.Sql/servers/databases_ resource (child). If a deployment stack is created using the Bicep file with the `deny-settings-apply-to-child-scopes` setting enabled and the `deny-settings-mode` set to `denyWriteAndDelete`, you can't add any additional child resources to either the _Microsoft.Sql/servers_ resource or the _Microsoft.Sql/servers/databases_ resource.
694700
- `deny-settings-excluded-actions`: List of role-based access control (RBAC) management operations excluded from the deny settings. Up to 200 actions are allowed.
695701
- `deny-settings-excluded-principals`: List of Microsoft Entra principal IDs excluded from the lock. Up to five principals are allowed.
696702

articles/azure-resource-manager/bicep/tutorial-use-deployment-stacks.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ az stack group create \
8282
--deny-settings-mode 'none'
8383
```
8484

85-
Use the `action-on-unmanage` switch to define what happens to resources that are no longer managed after a stack is updated or deleted. For more information, see [Control detachment and deletion](./deployment-stacks.md#control-detachment-and-deletion). The `deny-settings-mode` switch assigns a specific type of permissions to the managed resources, which prevents their deletion by unauthorized security principals. For more information, see [Protect managed resources against deletion](./deployment-stacks.md#protect-managed-resources-against-deletion).
85+
Use the `action-on-unmanage` switch to define what happens to resources that are no longer managed after a stack is updated or deleted. For more information, see [Control detachment and deletion](./deployment-stacks.md#control-detachment-and-deletion). The `deny-settings-mode` switch assigns a specific type of permissions to the managed resources, which prevents their deletion by unauthorized security principals. For more information, see [Protect managed resources against deletion](./deployment-stacks.md#protect-managed-resources).
8686

8787
# [PowerShell](#tab/azure-powershell)
8888

@@ -99,7 +99,7 @@ New-AzResourceGroupDeploymentStack `
9999
-DenySettingsMode "none"
100100
```
101101

102-
Use the `ActionOnUnmanage` switch to define what happens to resources that are no longer managed after a stack is updated or deleted. For more information, see [Control detachment and deletion](./deployment-stacks.md#control-detachment-and-deletion). The `DenySettingsMode` switch assigns a specific type of permissions to the managed resources, which prevents their deletion by unauthorized security principals. For more information, see [Protect managed resources against deletion](./deployment-stacks.md#protect-managed-resources-against-deletion).
102+
Use the `ActionOnUnmanage` switch to define what happens to resources that are no longer managed after a stack is updated or deleted. For more information, see [Control detachment and deletion](./deployment-stacks.md#control-detachment-and-deletion). The `DenySettingsMode` switch assigns a specific type of permissions to the managed resources, which prevents their deletion by unauthorized security principals. For more information, see [Protect managed resources against deletion](./deployment-stacks.md#protect-managed-resources).
103103

104104
---
105105

@@ -677,7 +677,7 @@ The Azure CLI includes these parameters to customize the deny assignment:
677677

678678
---
679679

680-
In this tutorial, you configure the deny settings mode. For more information about other deny settings, see [Protect managed resources against deletion](./deployment-stacks.md#protect-managed-resources-against-deletion).
680+
In this tutorial, you configure the deny settings mode. For more information about other deny settings, see [Protect managed resources against deletion](./deployment-stacks.md#protect-managed-resources).
681681

682682
At the end of the previous step, you have one stack with two managed resources.
683683

articles/role-based-access-control/deny-assignments.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ This article describes how to list deny assignments.
2121
2222
## How deny assignments are created
2323

24-
Deny assignments are created and managed by Azure to protect resources. You can't directly create your own deny assignments. However, you can specify deny settings when creating a deployment stack, which creates a deny assignment that is owned by the deployment stack resources. Deployment stacks is currently in preview. For more information, see [Protect managed resources against deletion](../azure-resource-manager/bicep/deployment-stacks.md#protect-managed-resources-against-deletion).
24+
Deny assignments are created and managed by Azure to protect resources. You can't directly create your own deny assignments. However, you can specify deny settings when creating a deployment stack, which creates a deny assignment that is owned by the deployment stack resources. Deployment stacks is currently in preview. For more information, see [Protect managed resources against deletion](../azure-resource-manager/bicep/deployment-stacks.md#protect-managed-resources).
2525

2626
## Compare role assignments and deny assignments
2727

@@ -80,7 +80,7 @@ All Principals can be combined with `ExcludePrincipals` to deny all principals e
8080
Follow these steps to list deny assignments.
8181

8282
> [!IMPORTANT]
83-
> You can't directly create your own deny assignments. Deny assignments are created and managed by Azure. For more information, see [Protect managed resources against deletion](../azure-resource-manager/bicep/deployment-stacks.md#protect-managed-resources-against-deletion).
83+
> You can't directly create your own deny assignments. Deny assignments are created and managed by Azure. For more information, see [Protect managed resources against deletion](../azure-resource-manager/bicep/deployment-stacks.md#protect-managed-resources).
8484
# [Azure portal](#tab/azure-portal)
8585

8686
### Prerequisites

0 commit comments

Comments
 (0)