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
> | `$filter=type+eq+'CustomRole'` | Filter based on the CustomRole type |
53
-
54
-
## List custom roles at a scope
94
+
## List all custom role definitions at a scope
55
95
56
-
To list custom roles at a scope, use the [Role Definitions - List](/rest/api/authorization/role-definitions/list) REST API.
96
+
To list custom role definitions at a scope, use the [Role Definitions - List](/rest/api/authorization/role-definitions/list) REST API.
57
97
58
98
1. Start with the following request:
59
99
60
100
```http
61
-
GET https://management.azure.com/{scope}/providers/Microsoft.Authorization/roleDefinitions?api-version=2022-04-01&$filter={filter}
101
+
GET https://management.azure.com/{scope}/providers/Microsoft.Authorization/roleDefinitions?$filter={filter}&api-version=2022-04-01
62
102
```
63
103
64
104
1. Within the URI, replace *{scope}* with the scope for which you want to list the roles.
@@ -78,14 +118,67 @@ To list custom roles at a scope, use the [Role Definitions - List](/rest/api/aut
78
118
> | --- | --- |
79
119
> | `$filter=type+eq+'CustomRole'` | Filter based on the CustomRole type |
80
120
121
+
The following example lists all custom role definitions in a subscription:
122
+
123
+
**Request**
124
+
125
+
```http
126
+
GET https://management.azure.com/subscriptions/473a4f86-11e3-48cb-9358-e13c220a2f15/providers/Microsoft.Authorization/roleDefinitions?$filter=type+eq+'CustomRole'&api-version=2022-04-01
127
+
```
128
+
129
+
**Response**
130
+
131
+
```json
132
+
{
133
+
"value": [
134
+
{
135
+
"properties": {
136
+
"roleName": "Billing Reader Plus",
137
+
"type": "CustomRole",
138
+
"description": "Read billing data and download invoices",
To get information about a custom role by its display name, use the [Role Definitions - Get](/rest/api/authorization/role-definitions/get) REST API.
176
+
To get information about a custom role definition by its display name, use the [Role Definitions - Get](/rest/api/authorization/role-definitions/get) REST API.
84
177
85
178
1. Start with the following request:
86
179
87
180
```http
88
-
GET https://management.azure.com/{scope}/providers/Microsoft.Authorization/roleDefinitions?api-version=2022-04-01&$filter={filter}
181
+
GET https://management.azure.com/{scope}/providers/Microsoft.Authorization/roleDefinitions?$filter={filter}&api-version=2022-04-01
89
182
```
90
183
91
184
1. Within the URI, replace *{scope}* with the scope for which you want to list the roles.
@@ -105,9 +198,62 @@ To get information about a custom role by its display name, use the [Role Defini
105
198
> | --- | --- |
106
199
> | `$filter=roleName+eq+'{roleDisplayName}'` | Use the URL encoded form of the exact display name of the role. For instance, `$filter=roleName+eq+'Virtual%20Machine%20Contributor'` |
107
200
201
+
The following example lists a custom role definition named Billing Reader Plus in a subscription:
202
+
203
+
**Request**
204
+
205
+
```http
206
+
GET https://management.azure.com/subscriptions/473a4f86-11e3-48cb-9358-e13c220a2f15/providers/Microsoft.Authorization/roleDefinitions?$filter=roleName+eq+'Billing Reader Plus'&api-version=2022-04-01
207
+
```
208
+
209
+
**Response**
210
+
211
+
```json
212
+
{
213
+
"value": [
214
+
{
215
+
"properties": {
216
+
"roleName": "Billing Reader Plus",
217
+
"type": "CustomRole",
218
+
"description": "Read billing data and download invoices",
To get information about a custom role by its unique identifier, use the [Role Definitions - Get](/rest/api/authorization/role-definitions/get) REST API.
256
+
To get information about a custom role definition by its unique identifier, use the [Role Definitions - Get](/rest/api/authorization/role-definitions/get) REST API.
111
257
112
258
1. Use the [Role Definitions - List](/rest/api/authorization/role-definitions/list) REST API to get the GUID identifier for the role.
113
259
@@ -129,6 +275,55 @@ To get information about a custom role by its unique identifier, use the [Role D
129
275
130
276
1. Replace *{roleDefinitionId}* with the GUID identifier of the role definition.
131
277
278
+
The following example lists a custom role definition with the identifier 17adabda-4bf1-4f4e-8c97-1f0cab6dea1c in a subscription:
279
+
280
+
**Request**
281
+
282
+
```http
283
+
GET https://management.azure.com/subscriptions/473a4f86-11e3-48cb-9358-e13c220a2f15/providers/Microsoft.Authorization/roleDefinitions/17adabda-4bf1-4f4e-8c97-1f0cab6dea1c?api-version=2022-04-01
284
+
```
285
+
286
+
**Response**
287
+
288
+
```json
289
+
{
290
+
"properties": {
291
+
"roleName": "Billing Reader Plus",
292
+
"type": "CustomRole",
293
+
"description": "Read billing data and download invoices",
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.
@@ -232,7 +427,7 @@ To create a custom role, use the [Role Definitions - Create Or Update](/rest/api
232
427
233
428
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.
234
429
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.
430
+
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 all custom role definitions](#list-all-custom-role-definitions) section.
236
431
237
432
1. Start with the following request:
238
433
@@ -324,7 +519,7 @@ To delete a custom role, use the [Role Definitions - Delete](/rest/api/authoriza
324
519
325
520
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).
326
521
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.
522
+
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 all custom role definitions](#list-all-custom-role-definitions) section.
0 commit comments