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
# Create or update Azure custom roles using Azure CLI
19
19
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
-
25
20
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.
26
21
27
22
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
60
55
61
56
## List a custom role definition
62
57
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.
64
59
65
60
```azurecli
66
61
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
183
178
az role definition update --role-definition {roleDefinition}
184
179
```
185
180
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.
Copy file name to clipboardExpand all lines: articles/role-based-access-control/custom-roles-portal.md
+12-9Lines changed: 12 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,13 +8,13 @@ manager: amycolannino
8
8
ms.service: role-based-access-control
9
9
ms.topic: how-to
10
10
ms.workload: identity
11
-
ms.date: 07/28/2022
11
+
ms.date: 04/05/2023
12
12
ms.author: rolyon
13
13
---
14
14
15
15
# Create or update Azure custom roles using the Azure portal
16
16
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.
18
18
19
19
## Prerequisites
20
20
@@ -39,7 +39,7 @@ There are three ways that you can start to create a custom role. You can clone a
39
39
40
40
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.
41
41
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)**.
43
43
44
44
The following screenshot shows the Access control (IAM) page opened for a subscription.
45
45
@@ -61,11 +61,11 @@ If an existing role does not quite have the permissions you need, you can clone
61
61
62
62
If you prefer, you can follow these steps to start a custom role from scratch.
63
63
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)**.
65
65
66
66
1. Click **Add** and then click **Add custom role**.
67
67
68
-

68
+

69
69
70
70
This opens the custom roles editor with the **Start from scratch** option selected.
71
71
@@ -129,7 +129,7 @@ If you prefer, you can specify most of your custom role values in a JSON file. Y
129
129
130
130
1. Click **Add** and then click **Add custom role**.
131
131
132
-

132
+

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).
205
205
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
+
206
209
### Exclude permissions
207
210
208
211
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`
238
241
239
242
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.
240
243
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.
242
245
243
246
1. Click **Add assignable scopes** to open the Add assignable scopes pane.
244
247
@@ -252,7 +255,7 @@ On the **Assignable scopes** tab, you specify where your custom role is availabl
252
255
253
256
## Step 6: JSON
254
257
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.
256
259
257
260
1. To edit the JSON, click **Edit**.
258
261
@@ -290,7 +293,7 @@ On the **Review + create** tab, you can review your custom role settings.
290
293
291
294
Follow these steps to view your custom roles.
292
295
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)**.
294
297
295
298
1. Click the **Roles** tab to see a list of all the built-in and custom roles.
# Create or update Azure custom roles using Azure PowerShell
20
20
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
-
26
21
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.
27
22
28
23
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).
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.
# Create or update Azure custom roles using the REST API
21
21
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
-
27
22
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.
28
23
29
24
## Prerequisites
@@ -381,7 +376,7 @@ To create a custom role, use the [Role Definitions - Create Or Update](/rest/api
381
376
382
377
1. If `assignableScopes` is a subscription or resource group, replace the *{subscriptionId}* or *{resourceGroup}* instances with your identifiers.
383
378
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.
385
380
386
381
1. In the `actions` property, add the actions that the role allows to be performed.
Copy file name to clipboardExpand all lines: articles/role-based-access-control/custom-roles.md
+6-10Lines changed: 6 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,17 +7,12 @@ manager: amycolannino
7
7
ms.service: role-based-access-control
8
8
ms.topic: conceptual
9
9
ms.workload: identity
10
-
ms.date: 09/13/2022
10
+
ms.date: 04/05/2023
11
11
ms.author: rolyon
12
12
---
13
13
14
14
# Azure custom roles
15
15
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
-
21
16
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.
22
17
23
18
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.
154
149
|`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. |
155
150
|`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). |
156
151
|`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). |
158
153
|`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). |
159
154
|`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). |
160
155
@@ -178,7 +173,8 @@ Instead of adding all of these strings, you could just add a wildcard string. Fo
178
173
Microsoft.CostManagement/exports/*
179
174
```
180
175
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.
182
178
183
179
## Who can create, delete, update, or view a custom role
184
180
@@ -210,9 +206,9 @@ The following list describes the limits for custom roles.
210
206
- Azure China 21Vianet can have up to 2000 custom roles for each tenant.
211
207
- You cannot set `AssignableScopes` to the root scope (`"/"`).
212
208
- 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.
214
210
- 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.
216
212
- Azure Resource Manager doesn't validate the management group's existence in the role definition's `AssignableScopes`.
217
213
218
214
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).
Copy file name to clipboardExpand all lines: articles/role-based-access-control/role-definitions.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ manager: amycolannino
8
8
ms.service: role-based-access-control
9
9
ms.topic: conceptual
10
10
ms.workload: identity
11
-
ms.date: 08/19/2022
11
+
ms.date: 04/05/2023
12
12
ms.author: rolyon
13
13
ms.custom:
14
14
---
@@ -353,7 +353,7 @@ Examples of valid assignable scopes include:
353
353
> | Management group and a subscription |`"/providers/Microsoft.Management/managementGroups/{groupId1}", "/subscriptions/{subscriptionId1}",`|
354
354
> | All scopes (applies only to built-in roles) |`"/"`|
355
355
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.
357
357
358
358
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.
0 commit comments