Skip to content

Commit b8e3f76

Browse files
Merge pull request #204073 from rolyon/rolyon-rbac-rest-api-version-2022-04-01-arm
[Azure RBAC] REST API version 2022-04-01 for ARM
2 parents e730079 + 090ecc3 commit b8e3f76

File tree

3 files changed

+31
-11
lines changed

3 files changed

+31
-11
lines changed

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

Lines changed: 9 additions & 3 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: 06/29/2021
11+
ms.date: 10/19/2022
1212
ms.author: rolyon
1313
---
1414

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

2424
## Prerequisites
2525

26-
For information about the prerequisites to add 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 role assignment conditions, see [Conditions prerequisites](conditions-prerequisites.md).
2733

2834
## Add a condition
2935

@@ -66,7 +72,7 @@ To use the template, you must specify the following input:
6672
{
6773
"name": "[parameters('roleAssignmentGuid')]",
6874
"type": "Microsoft.Authorization/roleAssignments",
69-
"apiVersion": "2020-04-01-preview", // API version to call the role assignment PUT.
75+
"apiVersion": "2022-04-01", // API version to call the role assignment PUT.
7076
"properties": {
7177
"roleDefinitionId": "[variables('StorageBlobDataReader')]",
7278
"principalId": "[parameters('principalId')]",

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ manager: amycolannino
77
ms.service: role-based-access-control
88
ms.topic: how-to
99
ms.workload: identity
10-
ms.date: 12/16/2020
10+
ms.date: 10/19/2022
1111
ms.author: rolyon
1212
ms.custom: devx-track-azurepowershell
1313

@@ -33,6 +33,12 @@ To create a custom role, you must have:
3333

3434
- Permissions to create custom roles, such as [Owner](built-in-roles.md#owner) or [User Access Administrator](built-in-roles.md#user-access-administrator).
3535

36+
You must use the following version:
37+
38+
- `2018-07-01` or later
39+
40+
For more information, see [API versions of Azure RBAC REST APIs](/rest/api/authorization/versions).
41+
3642
## Review the template
3743

3844
The template used in this article is from [Azure Quickstart Templates](https://azure.microsoft.com/resources/templates/create-role-def). The template has four parameters and a resources section. The four parameters are:
@@ -173,7 +179,7 @@ Here are the changes you would need to make to the previous Quickstart template
173179
"resources": [
174180
{
175181
"type": "Microsoft.Authorization/roleDefinitions",
176-
"apiVersion": "2018-07-01",
182+
"apiVersion": "2022-04-01",
177183
"name": "[parameters('roleDefName')]",
178184
"properties": {
179185
...

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

Lines changed: 14 additions & 6 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: how-to
1010
ms.workload: identity
11-
ms.date: 09/07/2022
11+
ms.date: 10/19/2022
1212
ms.author: rolyon
1313
ms.custom: devx-track-azurepowershell, devx-track-azurecli
1414
ms.devlang: azurecli
@@ -26,6 +26,14 @@ ms.devlang: azurecli
2626

2727
[!INCLUDE [Azure role assignment prerequisites](../../includes/role-based-access-control/prerequisites-role-assignments.md)]
2828

29+
You must use the following versions:
30+
31+
- `2018-09-01-preview` or later to assign an Azure role to a new service principal
32+
- `2020-04-01-preview` or later to assign an Azure role at resource scope
33+
- `2022-04-01` is the first stable version
34+
35+
For more information, see [API versions of Azure RBAC REST APIs](/rest/api/authorization/versions).
36+
2937
## Get object IDs
3038

3139
To assign a role, you need to specify the ID of the user, group, or application you want to assign the role to. The ID has the format: `11111111-1111-1111-1111-111111111111`. You can get the ID using the Azure portal, Azure PowerShell, or Azure CLI.
@@ -100,7 +108,7 @@ To use the template, you must do the following:
100108
"resources": [
101109
{
102110
"type": "Microsoft.Authorization/roleAssignments",
103-
"apiVersion": "2018-09-01-preview",
111+
"apiVersion": "2022-04-01",
104112
"name": "[guid(resourceGroup().id)]",
105113
"properties": {
106114
"roleDefinitionId": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')]",
@@ -175,7 +183,7 @@ To use the template, you must specify the following inputs:
175183
"resources": [
176184
{
177185
"type": "Microsoft.Authorization/roleAssignments",
178-
"apiVersion": "2018-09-01-preview",
186+
"apiVersion": "2022-04-01",
179187
"name": "[parameters('roleNameGuid')]",
180188
"properties": {
181189
"roleDefinitionId": "[variables(parameters('builtInRoleType'))]",
@@ -277,7 +285,7 @@ To use the template, you must specify the following inputs:
277285
},
278286
{
279287
"type": "Microsoft.Authorization/roleAssignments",
280-
"apiVersion": "2020-04-01-preview",
288+
"apiVersion": "2022-04-01",
281289
"name": "[parameters('roleNameGuid')]",
282290
"scope": "[concat('Microsoft.Storage/storageAccounts', '/', variables('storageName'))]",
283291
"dependsOn": [
@@ -310,7 +318,7 @@ The following shows an example of the Contributor role assignment to a user for
310318

311319
If you create a new service principal and immediately try to assign a role to that service principal, that role assignment can fail in some cases. For example, if you create a new managed identity and then try to assign a role to that service principal in the same Azure Resource Manager template, the role assignment might fail. The reason for this failure is likely a replication delay. The service principal is created in one region; however, the role assignment might occur in a different region that hasn't replicated the service principal yet.
312320

313-
To address this scenario, you should set the `principalType` property to `ServicePrincipal` when creating the role assignment. You must also set the `apiVersion` of the role assignment to `2018-09-01-preview` or later.
321+
To address this scenario, you should set the `principalType` property to `ServicePrincipal` when creating the role assignment. You must also set the `apiVersion` of the role assignment to `2018-09-01-preview` or later. `2022-04-01` is the first stable version.
314322

315323
The following template demonstrates:
316324

@@ -346,7 +354,7 @@ To use the template, you must specify the following inputs:
346354
},
347355
{
348356
"type": "Microsoft.Authorization/roleAssignments",
349-
"apiVersion": "2018-09-01-preview",
357+
"apiVersion": "2022-04-01",
350358
"name": "[variables('bootstrapRoleAssignmentId')]",
351359
"dependsOn": [
352360
"[resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', variables('identityName'))]"

0 commit comments

Comments
 (0)