Skip to content

Commit 2c95fa1

Browse files
Merge pull request #199006 from rolyon/rolyon-rbac-custom-roles-management-group-scope-ga
[Azure RBAC] Custom roles for management groups
2 parents b3cb55b + 2229a05 commit 2c95fa1

File tree

8 files changed

+55
-49
lines changed

8 files changed

+55
-49
lines changed

articles/role-based-access-control/custom-roles-cli.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,12 @@ ms.service: role-based-access-control
1111
ms.topic: how-to
1212
ms.tgt_pltfrm: na
1313
ms.workload: identity
14-
ms.date: 07/28/2022
14+
ms.date: 04/05/2023
1515
ms.author: rolyon
1616
ms.reviewer: bagovind
1717
---
1818
# Create or update Azure custom roles using Azure CLI
1919

20-
> [!IMPORTANT]
21-
> Adding a management group to `AssignableScopes` is currently in preview.
22-
> This preview version is provided without a service level agreement, and it's not recommended for production workloads. Certain features might not be supported or might have constrained capabilities.
23-
> For more information, see [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/support/legal/preview-supplemental-terms/).
24-
2520
If the [Azure built-in roles](built-in-roles.md) don't meet the specific needs of your organization, you can create your own custom roles. This article describes how to list, create, update, or delete custom roles using Azure CLI.
2621

2722
For a step-by-step tutorial on how to create a custom role, see [Tutorial: Create an Azure custom role using Azure CLI](tutorial-custom-role-cli.md).
@@ -60,7 +55,7 @@ az role definition list --custom-role-only true --output json --query '[].{roleN
6055

6156
## List a custom role definition
6257

63-
To list a custom role definition, use [az role definition list](/cli/azure/role/definition#az-role-definition-list). This is the same command you would use for a built-in role.
58+
To list a custom role definition, use [az role definition list](/cli/azure/role/definition#az-role-definition-list). This command is the same command you would use for a built-in role.
6459

6560
```azurecli
6661
az role definition list --name {roleName}
@@ -183,7 +178,7 @@ To update a custom role, first use [az role definition list](/cli/azure/role/def
183178
az role definition update --role-definition {roleDefinition}
184179
```
185180

186-
The following example adds the *Microsoft.Insights/diagnosticSettings/* action to `Actions` and adds a management group to `AssignableScopes` for the *Virtual Machine Operator* custom role. Adding a management group to `AssignableScopes` is currently in preview.
181+
The following example adds the *Microsoft.Insights/diagnosticSettings/* action to `Actions` and adds a management group to `AssignableScopes` for the *Virtual Machine Operator* custom role.
187182

188183
vmoperator.json
189184

articles/role-based-access-control/custom-roles-portal.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ manager: amycolannino
88
ms.service: role-based-access-control
99
ms.topic: how-to
1010
ms.workload: identity
11-
ms.date: 07/28/2022
11+
ms.date: 04/05/2023
1212
ms.author: rolyon
1313
---
1414

1515
# Create or update Azure custom roles using the Azure portal
1616

17-
If the [Azure built-in roles](built-in-roles.md) don't meet the specific needs of your organization, you can create your own Azure custom roles. Just like built-in roles, you can assign custom roles to users, groups, and service principals at management group (in preview only), subscription and resource group scopes. Custom roles are stored in an Azure Active Directory (Azure AD) directory and can be shared across subscriptions. Each directory can have up to 5000 custom roles. Custom roles can be created using the Azure portal, Azure PowerShell, Azure CLI, or the REST API. This article describes how to create custom roles using the Azure portal.
17+
If the [Azure built-in roles](built-in-roles.md) don't meet the specific needs of your organization, you can create your own Azure custom roles. Just like built-in roles, you can assign custom roles to users, groups, and service principals at management group, subscription and resource group scopes. Custom roles are stored in an Azure Active Directory (Azure AD) directory and can be shared across subscriptions. Each directory can have up to 5000 custom roles. Custom roles can be created using the Azure portal, Azure PowerShell, Azure CLI, or the REST API. This article describes how to create custom roles using the Azure portal.
1818

1919
## Prerequisites
2020

@@ -39,7 +39,7 @@ There are three ways that you can start to create a custom role. You can clone a
3939

4040
If an existing role does not quite have the permissions you need, you can clone it and then modify the permissions. Follow these steps to start cloning a role.
4141

42-
1. In the Azure portal, open a subscription or resource group where you want the custom role to be assignable and then open **Access control (IAM)**.
42+
1. In the Azure portal, open a management group, subscription, or resource group where you want the custom role to be assignable and then open **Access control (IAM)**.
4343

4444
The following screenshot shows the Access control (IAM) page opened for a subscription.
4545

@@ -61,11 +61,11 @@ If an existing role does not quite have the permissions you need, you can clone
6161

6262
If you prefer, you can follow these steps to start a custom role from scratch.
6363

64-
1. In the Azure portal, open a subscription or resource group where you want the custom role to be assignable and then open **Access control (IAM)**.
64+
1. In the Azure portal, open a management group, subscription, or resource group where you want the custom role to be assignable and then open **Access control (IAM)**.
6565

6666
1. Click **Add** and then click **Add custom role**.
6767

68-
![Add custom role menu](./media/custom-roles-portal/add-custom-role-menu.png)
68+
![Screenshot showing Add custom role menu.](./media/custom-roles-portal/add-custom-role-menu.png)
6969

7070
This opens the custom roles editor with the **Start from scratch** option selected.
7171

@@ -129,7 +129,7 @@ If you prefer, you can specify most of your custom role values in a JSON file. Y
129129

130130
1. Click **Add** and then click **Add custom role**.
131131

132-
![Add custom role menu](./media/custom-roles-portal/add-custom-role-menu.png)
132+
![Screenshot showing Add custom role menu.](./media/custom-roles-portal/add-custom-role-menu.png)
133133

134134
This opens the custom roles editor.
135135

@@ -203,6 +203,9 @@ Microsoft.CostManagement/exports/*
203203
204204
If you want to add a new wildcard permission, you can't add it using the **Add permissions** pane. To add a wildcard permission, you have to add it manually using the **JSON** tab. For more information, see [Step 6: JSON](#step-6-json).
205205
206+
> [!NOTE]
207+
> It's recommended that you specify `Actions` and `DataActions` explicitly instead of using the wildcard (`*`) character. The additional access and permissions granted through future `Actions` or `DataActions` may be unwanted behavior using the wildcard.
208+
206209
### Exclude permissions
207210
208211
If your role has a wildcard (`*`) permission and you want to exclude or subtract specific permissions from that wildcard permission, you can exclude them. For example, let's say that you have the following wildcard permission:
@@ -238,7 +241,7 @@ When you exclude a permission, it is added as a `NotActions` or `NotDataActions`
238241
239242
On the **Assignable scopes** tab, you specify where your custom role is available for assignment, such as management group, subscriptions, or resource groups. Depending on how you chose to start, this tab might already list the scope where you opened the Access control (IAM) page.
240243
241-
You can only define one management group in assignable scopes. Adding a management group to assignable scopes is currently in preview. Setting assignable scope to root scope ("/") is not supported.
244+
You can define only one management group in assignable scopes. Setting assignable scope to root scope ("/") is not supported.
242245
243246
1. Click **Add assignable scopes** to open the Add assignable scopes pane.
244247
@@ -252,7 +255,7 @@ On the **Assignable scopes** tab, you specify where your custom role is availabl
252255
253256
## Step 6: JSON
254257
255-
On the **JSON** tab, you see your custom role formatted in JSON. If you want, you can directly edit the JSON. If you want to add a wildcard (`*`) permission, you must use this tab.
258+
On the **JSON** tab, you see your custom role formatted in JSON. If you want, you can directly edit the JSON.
256259
257260
1. To edit the JSON, click **Edit**.
258261
@@ -290,7 +293,7 @@ On the **Review + create** tab, you can review your custom role settings.
290293
291294
Follow these steps to view your custom roles.
292295
293-
1. Open a subscription or resource group and then open **Access control (IAM)**.
296+
1. Open a management group, subscription, or resource group and then open **Access control (IAM)**.
294297
295298
1. Click the **Roles** tab to see a list of all the built-in and custom roles.
296299

articles/role-based-access-control/custom-roles-powershell.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,13 @@ ms.service: role-based-access-control
1111
ms.topic: how-to
1212
ms.tgt_pltfrm: na
1313
ms.workload: identity
14-
ms.date: 07/28/2022
14+
ms.date: 04/05/2023
1515
ms.author: rolyon
1616
ms.reviewer: bagovind
1717
ms.custom: devx-track-azurepowershell
1818
---
1919
# Create or update Azure custom roles using Azure PowerShell
2020

21-
> [!IMPORTANT]
22-
> Adding a management group to `AssignableScopes` is currently in preview.
23-
> This preview version is provided without a service level agreement, and it's not recommended for production workloads. Certain features might not be supported or might have constrained capabilities.
24-
> For more information, see [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/support/legal/preview-supplemental-terms/).
25-
2621
If the [Azure built-in roles](built-in-roles.md) don't meet the specific needs of your organization, you can create your own custom roles. This article describes how to list, create, update, or delete custom roles using Azure PowerShell.
2722

2823
For a step-by-step tutorial on how to create a custom role, see [Tutorial: Create an Azure custom role using Azure PowerShell](tutorial-custom-role-powershell.md).
@@ -297,7 +292,7 @@ AssignableScopes : {/subscriptions/00000000-0000-0000-0000-000000000000,
297292
/subscriptions/22222222-2222-2222-2222-222222222222}
298293
```
299294

300-
The following example adds a management group to `AssignableScopes` of the *Virtual Machine Operator* custom role. Adding a management group to `AssignableScopes` is currently in preview.
295+
The following example adds a management group to `AssignableScopes` of the *Virtual Machine Operator* custom role.
301296

302297
```azurepowershell
303298
Get-AzManagementGroup

articles/role-based-access-control/custom-roles-rest.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,13 @@ ms.service: role-based-access-control
1212
ms.workload: multiple
1313
ms.tgt_pltfrm: rest-api
1414
ms.topic: how-to
15-
ms.date: 03/20/2023
15+
ms.date: 04/05/2023
1616
ms.author: rolyon
1717
ms.reviewer: bagovind
1818

1919
---
2020
# Create or update Azure custom roles using the REST API
2121

22-
> [!IMPORTANT]
23-
> Adding a management group to `AssignableScopes` is currently in preview.
24-
> This preview version is provided without a service level agreement, and it's not recommended for production workloads. Certain features might not be supported or might have constrained capabilities.
25-
> For more information, see [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/support/legal/preview-supplemental-terms/).
26-
2722
If the [Azure built-in roles](built-in-roles.md) don't meet the specific needs of your organization, you can create your own custom roles. This article describes how to list, create, update, or delete custom roles using the REST API.
2823

2924
## Prerequisites
@@ -381,7 +376,7 @@ To create a custom role, use the [Role Definitions - Create Or Update](/rest/api
381376
382377
1. If `assignableScopes` is a subscription or resource group, replace the *{subscriptionId}* or *{resourceGroup}* instances with your identifiers.
383378
384-
1. If `assignableScopes` is a management group, replace the *{groupId}* instance with your management group identifier. Adding a management group to `assignableScopes` is currently in preview.
379+
1. If `assignableScopes` is a management group, replace the *{groupId}* instance with your management group identifier.
385380
386381
1. In the `actions` property, add the actions that the role allows to be performed.
387382

articles/role-based-access-control/custom-roles.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,12 @@ manager: amycolannino
77
ms.service: role-based-access-control
88
ms.topic: conceptual
99
ms.workload: identity
10-
ms.date: 09/13/2022
10+
ms.date: 04/05/2023
1111
ms.author: rolyon
1212
---
1313

1414
# Azure custom roles
1515

16-
> [!IMPORTANT]
17-
> Adding a management group to `AssignableScopes` is currently in preview.
18-
> This preview version is provided without a service level agreement, and it's not recommended for production workloads. Certain features might not be supported or might have constrained capabilities.
19-
> For more information, see [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/support/legal/preview-supplemental-terms/).
20-
2116
If the [Azure built-in roles](built-in-roles.md) don't meet the specific needs of your organization, you can create your own custom roles. Just like built-in roles, you can assign custom roles to users, groups, and service principals at management group (in preview only), subscription, and resource group scopes.
2217

2318
Custom roles can be shared between subscriptions that trust the same Azure AD tenant. There is a limit of **5,000** custom roles per tenant. (For Azure China 21Vianet, the limit is 2,000 custom roles.) Custom roles can be created using the Azure portal, Azure PowerShell, Azure CLI, or the REST API.
@@ -154,7 +149,7 @@ The following table describes what the custom role properties mean.
154149
| `Description`</br>`description` | Yes | String | The description of the custom role. Can include letters, numbers, spaces, and special characters. Maximum number of characters is 2048. |
155150
| `Actions`</br>`actions` | Yes | String[] | An array of strings that specifies the control plane actions that the role allows to be performed. For more information, see [Actions](role-definitions.md#actions). |
156151
| `NotActions`</br>`notActions` | No | String[] | An array of strings that specifies the control plane actions that are excluded from the allowed `Actions`. For more information, see [NotActions](role-definitions.md#notactions). |
157-
| `DataActions`</br>`dataActions` | No | String[] | An array of strings that specifies the data plane actions that the role allows to be performed to your data within that object. If you create a custom role with `DataActions`, that role cannot be assigned at the management group scope. For more information, see [DataActions](role-definitions.md#dataactions). |
152+
| `DataActions`</br>`dataActions` | No | String[] | An array of strings that specifies the data plane actions that the role allows to be performed to your data within that object. If you create a custom role with `DataActions`, that role can't be assigned at the management group scope. For more information, see [DataActions](role-definitions.md#dataactions). |
158153
| `NotDataActions`</br>`notDataActions` | No | String[] | An array of strings that specifies the data plane actions that are excluded from the allowed `DataActions`. For more information, see [NotDataActions](role-definitions.md#notdataactions). |
159154
| `AssignableScopes`</br>`assignableScopes` | Yes | String[] | An array of strings that specifies the scopes that the custom role is available for assignment. Maximum number of `AssignableScopes` is 2,000. For more information, see [AssignableScopes](role-definitions.md#assignablescopes). |
160155

@@ -178,7 +173,8 @@ Instead of adding all of these strings, you could just add a wildcard string. Fo
178173
Microsoft.CostManagement/exports/*
179174
```
180175

181-
It's recommended that you specify `Actions` and `DataActions` explicitly instead of using the wildcard (`*`) character. The additional access and permissions granted through future `Actions` or `DataActions` may be unwanted behavior using the wildcard.
176+
> [!NOTE]
177+
> It's recommended that you specify `Actions` and `DataActions` explicitly instead of using the wildcard (`*`) character. The additional access and permissions granted through future `Actions` or `DataActions` may be unwanted behavior using the wildcard.
182178
183179
## Who can create, delete, update, or view a custom role
184180

@@ -210,9 +206,9 @@ The following list describes the limits for custom roles.
210206
- Azure China 21Vianet can have up to 2000 custom roles for each tenant.
211207
- You cannot set `AssignableScopes` to the root scope (`"/"`).
212208
- You cannot use wildcards (`*`) in `AssignableScopes`. This wildcard restriction helps ensure a user can't potentially obtain access to a scope by updating the role definition.
213-
- You can only define one management group in `AssignableScopes` of a custom role. Adding a management group to `AssignableScopes` is currently in preview.
209+
- You can define only one management group in `AssignableScopes` of a custom role.
214210
- You can have only one wildcard in an action string.
215-
- Custom roles with `DataActions` cannot be assigned at the management group scope.
211+
- Custom roles with `DataActions` can't be assigned at the management group scope.
216212
- Azure Resource Manager doesn't validate the management group's existence in the role definition's `AssignableScopes`.
217213

218214
For more information about custom roles and management groups, see [What are Azure management groups?](../governance/management-groups/overview.md#azure-custom-role-definition-and-assignment).
-4.84 KB
Loading

articles/role-based-access-control/role-definitions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ manager: amycolannino
88
ms.service: role-based-access-control
99
ms.topic: conceptual
1010
ms.workload: identity
11-
ms.date: 08/19/2022
11+
ms.date: 04/05/2023
1212
ms.author: rolyon
1313
ms.custom:
1414
---
@@ -353,7 +353,7 @@ Examples of valid assignable scopes include:
353353
> | Management group and a subscription | `"/providers/Microsoft.Management/managementGroups/{groupId1}", "/subscriptions/{subscriptionId1}",` |
354354
> | All scopes (applies only to built-in roles) | `"/"` |
355355
356-
You can define only one management group in `AssignableScopes` of a custom role. Adding a management group to `AssignableScopes` is currently in preview.
356+
You can define only one management group in `AssignableScopes` of a custom role.
357357

358358
Although it's possible to create a custom role with a resource instance in `AssignableScopes` using the command line, it's not recommended. Each tenant supports a maximum of 5000 custom roles. Using this strategy could potentially exhaust your available custom roles. Ultimately, the level of access is determined by the custom role assignment (scope + role permissions + security principal) and not the `AssignableScopes` listed in the custom role. So, create your custom roles with `AssignableScopes` of management group, subscription, or resource group, but assign the custom roles with narrow scope, such as resource or resource group.
359359

0 commit comments

Comments
 (0)