Skip to content

Commit 48f2f99

Browse files
authored
Merge pull request #203669 from rolyon/rolyon-rbac-rest-api-version-2022-04-01
[Azure RBAC] REST API version 2022-04-01
2 parents b6e80c8 + 23af802 commit 48f2f99

9 files changed

+177
-92
lines changed

articles/role-based-access-control/conditions-prerequisites.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.service: role-based-access-control
88
ms.subservice: conditions
99
ms.topic: conceptual
1010
ms.workload: identity
11-
ms.date: 11/16/2021
11+
ms.date: 10/19/2022
1212
ms.author: rolyon
1313

1414
#Customer intent:
@@ -42,6 +42,16 @@ When using Azure CLI to add or update conditions, you must use the following ver
4242

4343
- [Azure CLI 2.18 or later](/cli/azure/install-azure-cli)
4444

45+
## REST API
46+
47+
When using the REST API to add or update conditions, you must use the following versions:
48+
49+
- `2020-03-01-preview` or later
50+
- `2020-04-01-preview` or later if you want to utilize the `description` property for role assignments
51+
- `2022-04-01` is the first stable version
52+
53+
For more information, see [API versions of Azure RBAC REST APIs](/rest/api/authorization/versions).
54+
4555
## Permissions
4656

4757
Just like role assignments, to add or update conditions, you must be signed in to Azure with a user that has the `Microsoft.Authorization/roleAssignments/write` and `Microsoft.Authorization/roleAssignments/delete` permissions, such as [User Access Administrator](built-in-roles.md#user-access-administrator) or [Owner](built-in-roles.md#owner).

articles/role-based-access-control/conditions-role-assignments-rest.md

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.service: role-based-access-control
88
ms.subservice: conditions
99
ms.topic: how-to
1010
ms.workload: identity
11-
ms.date: 05/07/2021
11+
ms.date: 10/19/2022
1212
ms.author: rolyon
1313
---
1414

@@ -23,11 +23,17 @@ An [Azure role assignment condition](conditions-overview.md) is an additional ch
2323

2424
## Prerequisites
2525

26-
For information about the prerequisites to add or edit role assignment conditions, see [Conditions prerequisites](conditions-prerequisites.md).
26+
You must use the following versions:
27+
28+
- `2020-03-01-preview` or later
29+
- `2020-04-01-preview` or later if you want to utilize the `description` property for role assignments
30+
- `2022-04-01` is the first stable version
31+
32+
For more information about the prerequisites to add or edit role assignment conditions, see [Conditions prerequisites](conditions-prerequisites.md).
2733

2834
## Add a condition
2935

30-
To add a role assignment condition, use the [Role Assignments - Create](/rest/api/authorization/roleassignments/create) REST API. Set the `api-version` to `2020-03-01-preview` or later. If you want to utilize the `description` property for role assignments, use `2020-04-01-preview` or later. [Role Assignments - Create](/rest/api/authorization/roleassignments/create) includes the following parameters related to conditions.
36+
To add a role assignment condition, use the [Role Assignments - Create](/rest/api/authorization/role-assignments/create) REST API. [Role Assignments - Create](/rest/api/authorization/role-assignments/create) includes the following parameters related to conditions.
3137

3238
| Parameter | Type | Description |
3339
| --- | --- | --- |
@@ -37,7 +43,7 @@ To add a role assignment condition, use the [Role Assignments - Create](/rest/ap
3743
Use the following request and body:
3844

3945
```http
40-
PUT https://management.azure.com/{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentId}?api-version=2020-04-01-preview
46+
PUT https://management.azure.com/{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentId}?api-version=2022-04-01
4147
```
4248

4349
```json
@@ -55,7 +61,7 @@ PUT https://management.azure.com/{scope}/providers/Microsoft.Authorization/roleA
5561
The following example shows how to assign the [Storage Blob Data Reader](built-in-roles.md#storage-blob-data-reader) role with a condition. The condition checks whether container name equals 'blobs-example-container'.
5662

5763
```http
58-
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentId}?api-version=2020-04-01-preview
64+
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentId}?api-version=2022-04-01
5965
```
6066

6167
```json
@@ -81,8 +87,8 @@ The following shows an example of the output:
8187
"scope": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}",
8288
"condition": "((!(ActionMatches{'Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read'})) OR (@Resource[Microsoft.Storage/storageAccounts/blobServices/containers:name] StringEquals 'blobs-example-container'))",
8389
"conditionVersion": "2.0",
84-
"createdOn": "2021-04-20T06:20:44.0205560Z",
85-
"updatedOn": "2021-04-20T06:20:44.2955371Z",
90+
"createdOn": "2022-07-20T06:20:44.0205560Z",
91+
"updatedOn": "2022-07-20T06:20:44.2955371Z",
8692
"createdBy": null,
8793
"updatedBy": "{updatedById}",
8894
"delegatedManagedIdentityResourceId": null,
@@ -96,10 +102,10 @@ The following shows an example of the output:
96102

97103
## Edit a condition
98104

99-
To edit an existing role assignment condition, use the same [Role Assignments - Create](/rest/api/authorization/roleassignments/create) REST API as you used to add the role assignment condition. The following shows an example JSON where `condition` and `description` are updated. Only the `condition`, `conditionVersion`, and `description` properties can be edited. You must specify the other properties to match the existing role assignment.
105+
To edit an existing role assignment condition, use the same [Role Assignments - Create](/rest/api/authorization/role-assignments/create) REST API as you used to add the role assignment condition. The following shows an example JSON where `condition` and `description` are updated. Only the `condition`, `conditionVersion`, and `description` properties can be edited. You must specify the other properties to match the existing role assignment.
100106

101107
```http
102-
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentId}?api-version=2020-04-01-preview
108+
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentId}?api-version=2022-04-01
103109
```
104110

105111
```json
@@ -114,16 +120,15 @@ PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{
114120
}
115121
```
116122

117-
118123
## List a condition
119124

120-
To list a role assignment condition, use the [Role Assignments - List](/rest/api/authorization/roleassignments/list) API. Set the `api-version` to `2020-03-01-preview` or later. If you want to utilize the `description` property for role assignments, use `2020-04-01-preview` or later. For more information, see [List Azure role assignments using the REST API](role-assignments-list-rest.md).
125+
To list a role assignment condition, use the [Role Assignments](/rest/api/authorization/role-assignments) Get or List REST API. For more information, see [List Azure role assignments using the REST API](role-assignments-list-rest.md).
121126

122127
## Delete a condition
123128

124129
To delete a role assignment condition, edit the role assignment condition and set both the condition and condition version to either an empty string or null.
125130

126-
Alternatively, if you want to delete both the role assignment and the condition, you can use the [Role Assignments - Delete](/rest/api/authorization/roleassignments/delete) API. For more information, see [Remove Azure role assignments](role-assignments-remove.md).
131+
Alternatively, if you want to delete both the role assignment and the condition, you can use the [Role Assignments - Delete](/rest/api/authorization/role-assignments/delete) API. For more information, see [Remove Azure role assignments](role-assignments-remove.md).
127132

128133
## Next steps
129134

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

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ms.service: role-based-access-control
1212
ms.workload: multiple
1313
ms.tgt_pltfrm: rest-api
1414
ms.topic: how-to
15-
ms.date: 07/28/2022
15+
ms.date: 10/19/2022
1616
ms.author: rolyon
1717
ms.reviewer: bagovind
1818

@@ -26,14 +26,22 @@ ms.reviewer: bagovind
2626
2727
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.
2828

29+
## Prerequisites
30+
31+
You must use the following version:
32+
33+
- `2015-07-01` or later
34+
35+
For more information, see [API versions of Azure RBAC REST APIs](/rest/api/authorization/versions).
36+
2937
## List custom roles
3038

31-
To list all custom roles in a directory, use the [Role Definitions - List](/rest/api/authorization/roledefinitions/list) REST API.
39+
To list all custom roles in a directory, use the [Role Definitions - List](/rest/api/authorization/role-definitions/list) REST API.
3240

3341
1. Start with the following request:
3442

3543
```http
36-
GET https://management.azure.com/providers/Microsoft.Authorization/roleDefinitions?api-version=2015-07-01&$filter={filter}
44+
GET https://management.azure.com/providers/Microsoft.Authorization/roleDefinitions?api-version=2022-04-01&$filter={filter}
3745
```
3846
3947
1. Replace *{filter}* with the role type.
@@ -45,12 +53,12 @@ To list all custom roles in a directory, use the [Role Definitions - List](/rest
4553
4654
## List custom roles at a scope
4755
48-
To list custom roles at a scope, use the [Role Definitions - List](/rest/api/authorization/roledefinitions/list) REST API.
56+
To list custom roles at a scope, use the [Role Definitions - List](/rest/api/authorization/role-definitions/list) REST API.
4957
5058
1. Start with the following request:
5159
5260
```http
53-
GET https://management.azure.com/{scope}/providers/Microsoft.Authorization/roleDefinitions?api-version=2015-07-01&$filter={filter}
61+
GET https://management.azure.com/{scope}/providers/Microsoft.Authorization/roleDefinitions?api-version=2022-04-01&$filter={filter}
5462
```
5563
5664
1. Within the URI, replace *{scope}* with the scope for which you want to list the roles.
@@ -72,12 +80,12 @@ To list custom roles at a scope, use the [Role Definitions - List](/rest/api/aut
7280
7381
## List a custom role definition by name
7482
75-
To get information about a custom role by its display name, use the [Role Definitions - Get](/rest/api/authorization/roledefinitions/get) REST API.
83+
To get information about a custom role by its display name, use the [Role Definitions - Get](/rest/api/authorization/role-definitions/get) REST API.
7684
7785
1. Start with the following request:
7886
7987
```http
80-
GET https://management.azure.com/{scope}/providers/Microsoft.Authorization/roleDefinitions?api-version=2015-07-01&$filter={filter}
88+
GET https://management.azure.com/{scope}/providers/Microsoft.Authorization/roleDefinitions?api-version=2022-04-01&$filter={filter}
8189
```
8290
8391
1. Within the URI, replace *{scope}* with the scope for which you want to list the roles.
@@ -99,14 +107,14 @@ To get information about a custom role by its display name, use the [Role Defini
99107
100108
## List a custom role definition by ID
101109
102-
To get information about a custom role by its unique identifier, use the [Role Definitions - Get](/rest/api/authorization/roledefinitions/get) REST API.
110+
To get information about a custom role by its unique identifier, use the [Role Definitions - Get](/rest/api/authorization/role-definitions/get) REST API.
103111
104-
1. Use the [Role Definitions - List](/rest/api/authorization/roledefinitions/list) REST API to get the GUID identifier for the role.
112+
1. Use the [Role Definitions - List](/rest/api/authorization/role-definitions/list) REST API to get the GUID identifier for the role.
105113
106114
1. Start with the following request:
107115
108116
```http
109-
GET https://management.azure.com/{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId}?api-version=2015-07-01
117+
GET https://management.azure.com/{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId}?api-version=2022-04-01
110118
```
111119
112120
1. Within the URI, replace *{scope}* with the scope for which you want to list the roles.
@@ -123,7 +131,7 @@ To get information about a custom role by its unique identifier, use the [Role D
123131
124132
## Create a custom role
125133
126-
To create a custom role, use the [Role Definitions - Create Or Update](/rest/api/authorization/roledefinitions/createorupdate) REST API. To call this API, you must be signed in with a user that is assigned a role that has the `Microsoft.Authorization/roleDefinitions/write` permission on all the `assignableScopes`. Of the built-in roles, only [Owner](built-in-roles.md#owner) and [User Access Administrator](built-in-roles.md#user-access-administrator) include this permission.
134+
To create a custom role, use the [Role Definitions - Create Or Update](/rest/api/authorization/role-definitions/create-or-update) REST API. To call this API, you must be signed in with a user that is assigned a role that has the `Microsoft.Authorization/roleDefinitions/write` permission on all the `assignableScopes`. Of the built-in roles, only [Owner](built-in-roles.md#owner) and [User Access Administrator](built-in-roles.md#user-access-administrator) include this permission.
127135
128136
1. Review the list of [resource provider operations](resource-provider-operations.md) that are available to create the permissions for your custom role.
129137
@@ -132,7 +140,7 @@ To create a custom role, use the [Role Definitions - Create Or Update](/rest/api
132140
1. Start with the following request and body:
133141
134142
```http
135-
PUT https://management.azure.com/{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId}?api-version=2015-07-01
143+
PUT https://management.azure.com/{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId}?api-version=2022-04-01
136144
```
137145
138146
```json
@@ -222,14 +230,14 @@ To create a custom role, use the [Role Definitions - Create Or Update](/rest/api
222230
223231
## Update a custom role
224232
225-
To update a custom role, use the [Role Definitions - Create Or Update](/rest/api/authorization/roledefinitions/createorupdate) REST API. To call this API, you must be signed in with a user that is assigned a role that has the `Microsoft.Authorization/roleDefinitions/write` permission on all the `assignableScopes`. Of the built-in roles, only [Owner](built-in-roles.md#owner) and [User Access Administrator](built-in-roles.md#user-access-administrator) include this permission.
233+
To update a custom role, use the [Role Definitions - Create Or Update](/rest/api/authorization/role-definitions/create-or-update) REST API. To call this API, you must be signed in with a user that is assigned a role that has the `Microsoft.Authorization/roleDefinitions/write` permission on all the `assignableScopes`. Of the built-in roles, only [Owner](built-in-roles.md#owner) and [User Access Administrator](built-in-roles.md#user-access-administrator) include this permission.
226234
227-
1. Use the [Role Definitions - List](/rest/api/authorization/roledefinitions/list) or [Role Definitions - Get](/rest/api/authorization/roledefinitions/get) REST API to get information about the custom role. For more information, see the earlier [List custom roles](#list-custom-roles) section.
235+
1. Use the [Role Definitions - List](/rest/api/authorization/role-definitions/list) or [Role Definitions - Get](/rest/api/authorization/role-definitions/get) REST API to get information about the custom role. For more information, see the earlier [List custom roles](#list-custom-roles) section.
228236
229237
1. Start with the following request:
230238
231239
```http
232-
PUT https://management.azure.com/{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId}?api-version=2015-07-01
240+
PUT https://management.azure.com/{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId}?api-version=2022-04-01
233241
```
234242
235243
1. Within the URI, replace *{scope}* with the first `assignableScopes` of the custom role.
@@ -312,16 +320,16 @@ To update a custom role, use the [Role Definitions - Create Or Update](/rest/api
312320
313321
## Delete a custom role
314322
315-
To delete a custom role, use the [Role Definitions - Delete](/rest/api/authorization/roledefinitions/delete) REST API. To call this API, you must be signed in with a user that is assigned a role that has the `Microsoft.Authorization/roleDefinitions/delete` permission on all the `assignableScopes`. Of the built-in roles, only [Owner](built-in-roles.md#owner) and [User Access Administrator](built-in-roles.md#user-access-administrator) include this permission.
323+
To delete a custom role, use the [Role Definitions - Delete](/rest/api/authorization/role-definitions/delete) REST API. To call this API, you must be signed in with a user that is assigned a role that has the `Microsoft.Authorization/roleDefinitions/delete` permission on all the `assignableScopes`. Of the built-in roles, only [Owner](built-in-roles.md#owner) and [User Access Administrator](built-in-roles.md#user-access-administrator) include this permission.
316324
317325
1. Remove any role assignments that use the custom role. For more information, see [Find role assignments to delete a custom role](custom-roles.md#find-role-assignments-to-delete-a-custom-role).
318326
319-
1. Use the [Role Definitions - List](/rest/api/authorization/roledefinitions/list) or [Role Definitions - Get](/rest/api/authorization/roledefinitions/get) REST API to get the GUID identifier of the custom role. For more information, see the earlier [List custom roles](#list-custom-roles) section.
327+
1. Use the [Role Definitions - List](/rest/api/authorization/role-definitions/list) or [Role Definitions - Get](/rest/api/authorization/role-definitions/get) REST API to get the GUID identifier of the custom role. For more information, see the earlier [List custom roles](#list-custom-roles) section.
320328
321329
1. Start with the following request:
322330
323331
```http
324-
DELETE https://management.azure.com/{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId}?api-version=2015-07-01
332+
DELETE https://management.azure.com/{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId}?api-version=2022-04-01
325333
```
326334
327335
1. Within the URI, replace *{scope}* with the scope that you want to delete the custom role.

0 commit comments

Comments
 (0)