diff --git a/modules/aad/domain-service/README.md b/modules/aad/domain-service/README.md
index 673231c2f7..a62f0857f9 100644
--- a/modules/aad/domain-service/README.md
+++ b/modules/aad/domain-service/README.md
@@ -323,7 +323,7 @@ module domainService 'br:bicep/modules/aad.domain-service:1.0.0' = {
| [`notifyGlobalAdmins`](#parameter-notifyglobaladmins) | string | The value is to notify the Global Admins. |
| [`ntlmV1`](#parameter-ntlmv1) | string | The value is to enable clients making request using NTLM v1. |
| [`replicaSets`](#parameter-replicasets) | array | Additional replica set for the managed domain. |
-| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
+| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignments to create. |
| [`sku`](#parameter-sku) | string | The name of the SKU specific to Azure ADDS Services. |
| [`syncNtlmPasswords`](#parameter-syncntlmpasswords) | string | The value is to enable synchronized users to use NTLM authentication. |
| [`syncOnPremPasswords`](#parameter-synconprempasswords) | string | The value is to enable on-premises users to authenticate against managed domain. |
@@ -628,7 +628,7 @@ Additional replica set for the managed domain.
### Parameter: `roleAssignments`
-Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
+Array of role assignments to create.
- Required: No
- Type: array
@@ -641,7 +641,7 @@ Array of role assignment objects that contain the 'roleDefinitionIdOrName' and '
| [`description`](#parameter-roleassignmentsdescription) | No | string | Optional. The description of the role assignment. |
| [`principalId`](#parameter-roleassignmentsprincipalid) | Yes | string | Required. The principal ID of the principal (user/group/identity) to assign the role to. |
| [`principalType`](#parameter-roleassignmentsprincipaltype) | No | string | Optional. The principal type of the assigned principal ID. |
-| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead. |
+| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
### Parameter: `roleAssignments.condition`
@@ -689,7 +689,7 @@ Optional. The principal type of the assigned principal ID.
### Parameter: `roleAssignments.roleDefinitionIdOrName`
-Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.
+Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
- Required: Yes
- Type: string
diff --git a/modules/aad/domain-service/main.bicep b/modules/aad/domain-service/main.bicep
index 206efc45d4..5fd0a7a9fb 100644
--- a/modules/aad/domain-service/main.bicep
+++ b/modules/aad/domain-service/main.bicep
@@ -127,7 +127,7 @@ param enableDefaultTelemetry bool = true
@description('Optional. The lock settings of the service.')
param lock lockType
-@description('Optional. Array of role assignment objects that contain the \'roleDefinitionIdOrName\' and \'principalId\' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
+@description('Optional. Array of role assignments to create.')
param roleAssignments roleAssignmentType
var builtInRoleNames = {
@@ -213,7 +213,7 @@ resource domainService_lock 'Microsoft.Authorization/locks@2020-05-01' = if (!em
resource domainService_roleAssignments 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for (roleAssignment, index) in (roleAssignments ?? []): {
name: guid(domainService.id, roleAssignment.principalId, roleAssignment.roleDefinitionIdOrName)
properties: {
- roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : roleAssignment.roleDefinitionIdOrName
+ roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : contains(roleAssignment.roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/') ? roleAssignment.roleDefinitionIdOrName : subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleAssignment.roleDefinitionIdOrName)
principalId: roleAssignment.principalId
description: roleAssignment.?description
principalType: roleAssignment.?principalType
@@ -249,7 +249,7 @@ type lockType = {
}?
type roleAssignmentType = {
- @description('Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.')
+ @description('Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
roleDefinitionIdOrName: string
@description('Required. The principal ID of the principal (user/group/identity) to assign the role to.')
diff --git a/modules/aad/domain-service/main.json b/modules/aad/domain-service/main.json
index 6e3976bfcc..d0510c3e8a 100644
--- a/modules/aad/domain-service/main.json
+++ b/modules/aad/domain-service/main.json
@@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
- "version": "0.22.6.54827",
- "templateHash": "10052117540394396974"
+ "version": "0.23.1.45101",
+ "templateHash": "1250805842529058137"
},
"name": "Azure Active Directory Domain Services",
"description": "This module deploys an Azure Active Directory Domain Services (AADDS).",
@@ -46,7 +46,7 @@
"roleDefinitionIdOrName": {
"type": "string",
"metadata": {
- "description": "Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead."
+ "description": "Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
}
},
"principalId": {
@@ -411,7 +411,7 @@
"roleAssignments": {
"$ref": "#/definitions/roleAssignmentType",
"metadata": {
- "description": "Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
+ "description": "Optional. Array of role assignments to create."
}
}
},
@@ -518,7 +518,7 @@
"scope": "[format('Microsoft.AAD/domainServices/{0}', parameters('name'))]",
"name": "[guid(resourceId('Microsoft.AAD/domainServices', parameters('name')), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId, coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
"properties": {
- "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
+ "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], if(contains(coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)))]",
"principalId": "[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId]",
"description": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'description')]",
"principalType": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'principalType')]",
diff --git a/modules/analysis-services/server/README.md b/modules/analysis-services/server/README.md
index c35c2a2be3..88a08b2384 100644
--- a/modules/analysis-services/server/README.md
+++ b/modules/analysis-services/server/README.md
@@ -136,7 +136,17 @@ module server 'br:bicep/modules/analysis-services.server:1.0.0' = {
{
principalId: ''
principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: ''
}
]
skuCapacity: 1
@@ -217,7 +227,17 @@ module server 'br:bicep/modules/analysis-services.server:1.0.0' = {
{
"principalId": "",
"principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
+ "roleDefinitionIdOrName": "Owner"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": "b24988ac-6180-42a0-ab88-20f7382dd24c"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": ""
}
]
},
@@ -294,13 +314,6 @@ module server 'br:bicep/modules/analysis-services.server:1.0.0' = {
kind: 'CanNotDelete'
name: 'myCustomLockName'
}
- roleAssignments: [
- {
- principalId: ''
- principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
- }
- ]
skuCapacity: 1
skuName: 'S0'
tags: {
@@ -374,15 +387,6 @@ module server 'br:bicep/modules/analysis-services.server:1.0.0' = {
"name": "myCustomLockName"
}
},
- "roleAssignments": {
- "value": [
- {
- "principalId": "",
- "principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
- }
- ]
- },
"skuCapacity": {
"value": 1
},
@@ -421,7 +425,7 @@ module server 'br:bicep/modules/analysis-services.server:1.0.0' = {
| [`firewallSettings`](#parameter-firewallsettings) | object | The inbound firewall rules to define on the server. If not specified, firewall is disabled. |
| [`location`](#parameter-location) | string | Location for all Resources. |
| [`lock`](#parameter-lock) | object | The lock settings of the service. |
-| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
+| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignments to create. |
| [`skuCapacity`](#parameter-skucapacity) | int | The total number of query replica scale-out instances. |
| [`skuName`](#parameter-skuname) | string | The SKU name of the Azure Analysis Services server to create. |
| [`tags`](#parameter-tags) | object | Tags of the resource. |
@@ -609,7 +613,7 @@ The name of the Azure Analysis Services server to create.
### Parameter: `roleAssignments`
-Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
+Array of role assignments to create.
- Required: No
- Type: array
@@ -622,7 +626,7 @@ Array of role assignment objects that contain the 'roleDefinitionIdOrName' and '
| [`description`](#parameter-roleassignmentsdescription) | No | string | Optional. The description of the role assignment. |
| [`principalId`](#parameter-roleassignmentsprincipalid) | Yes | string | Required. The principal ID of the principal (user/group/identity) to assign the role to. |
| [`principalType`](#parameter-roleassignmentsprincipaltype) | No | string | Optional. The principal type of the assigned principal ID. |
-| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead. |
+| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
### Parameter: `roleAssignments.condition`
@@ -670,7 +674,7 @@ Optional. The principal type of the assigned principal ID.
### Parameter: `roleAssignments.roleDefinitionIdOrName`
-Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.
+Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
- Required: Yes
- Type: string
diff --git a/modules/analysis-services/server/main.bicep b/modules/analysis-services/server/main.bicep
index c0e59767e5..fe7c530a48 100644
--- a/modules/analysis-services/server/main.bicep
+++ b/modules/analysis-services/server/main.bicep
@@ -32,7 +32,7 @@ param diagnosticSettings diagnosticSettingType
@description('Optional. The lock settings of the service.')
param lock lockType
-@description('Optional. Array of role assignment objects that contain the \'roleDefinitionIdOrName\' and \'principalId\' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
+@description('Optional. Array of role assignments to create.')
param roleAssignments roleAssignmentType
@description('Optional. Tags of the resource.')
@@ -148,7 +148,7 @@ type lockType = {
}?
type roleAssignmentType = {
- @description('Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.')
+ @description('Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
roleDefinitionIdOrName: string
@description('Required. The principal ID of the principal (user/group/identity) to assign the role to.')
diff --git a/modules/analysis-services/server/main.json b/modules/analysis-services/server/main.json
index cb62fdcfee..b5a8657aef 100644
--- a/modules/analysis-services/server/main.json
+++ b/modules/analysis-services/server/main.json
@@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
- "templateHash": "11444956126966610005"
+ "templateHash": "16473107761572219540"
},
"name": "Analysis Services Servers",
"description": "This module deploys an Analysis Services Server.",
@@ -46,7 +46,7 @@
"roleDefinitionIdOrName": {
"type": "string",
"metadata": {
- "description": "Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead."
+ "description": "Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
}
},
"principalId": {
@@ -270,7 +270,7 @@
"roleAssignments": {
"$ref": "#/definitions/roleAssignmentType",
"metadata": {
- "description": "Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
+ "description": "Optional. Array of role assignments to create."
}
},
"tags": {
diff --git a/modules/analysis-services/server/tests/e2e/max/main.test.bicep b/modules/analysis-services/server/tests/e2e/max/main.test.bicep
index 95d51e6ea4..93bfb2efaa 100644
--- a/modules/analysis-services/server/tests/e2e/max/main.test.bicep
+++ b/modules/analysis-services/server/tests/e2e/max/main.test.bicep
@@ -85,7 +85,17 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
}
roleAssignments: [
{
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')
principalId: nestedDependencies.outputs.managedIdentityPrincipalId
principalType: 'ServicePrincipal'
}
diff --git a/modules/analysis-services/server/tests/e2e/waf-aligned/main.test.bicep b/modules/analysis-services/server/tests/e2e/waf-aligned/main.test.bicep
index e5705e2cbf..705eaf124d 100644
--- a/modules/analysis-services/server/tests/e2e/waf-aligned/main.test.bicep
+++ b/modules/analysis-services/server/tests/e2e/waf-aligned/main.test.bicep
@@ -83,13 +83,6 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
]
enablePowerBIService: true
}
- roleAssignments: [
- {
- roleDefinitionIdOrName: 'Reader'
- principalId: nestedDependencies.outputs.managedIdentityPrincipalId
- principalType: 'ServicePrincipal'
- }
- ]
diagnosticSettings: [
{
name: 'customSetting'
diff --git a/modules/api-management/service/README.md b/modules/api-management/service/README.md
index aa9604ceea..fd30fb48ed 100644
--- a/modules/api-management/service/README.md
+++ b/modules/api-management/service/README.md
@@ -250,7 +250,17 @@ module service 'br:bicep/modules/api-management.service:1.0.0' = {
{
principalId: ''
principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: ''
}
]
subscriptions: [
@@ -447,7 +457,17 @@ module service 'br:bicep/modules/api-management.service:1.0.0' = {
{
"principalId": "",
"principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
+ "roleDefinitionIdOrName": "Owner"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": "b24988ac-6180-42a0-ab88-20f7382dd24c"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": ""
}
]
},
@@ -616,13 +636,6 @@ module service 'br:bicep/modules/api-management.service:1.0.0' = {
subscriptionRequired: false
}
]
- roleAssignments: [
- {
- principalId: ''
- principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
- }
- ]
subscriptions: [
{
name: 'testArmSubscriptionAllApis'
@@ -812,15 +825,6 @@ module service 'br:bicep/modules/api-management.service:1.0.0' = {
}
]
},
- "roleAssignments": {
- "value": [
- {
- "principalId": "",
- "principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
- }
- ]
- },
"subscriptions": {
"value": [
{
@@ -882,7 +886,7 @@ module service 'br:bicep/modules/api-management.service:1.0.0' = {
| [`portalsettings`](#parameter-portalsettings) | array | Portal settings. |
| [`products`](#parameter-products) | array | Products. |
| [`restore`](#parameter-restore) | bool | Undelete API Management Service if it was previously soft-deleted. If this flag is specified and set to True all other properties will be ignored. |
-| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
+| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignments to create. |
| [`sku`](#parameter-sku) | string | The pricing tier of this API Management service. |
| [`skuCount`](#parameter-skucount) | int | The instance size of this API Management service. |
| [`subnetResourceId`](#parameter-subnetresourceid) | string | The full resource ID of a subnet in a virtual network to deploy the API Management service in. |
@@ -1233,7 +1237,7 @@ Undelete API Management Service if it was previously soft-deleted. If this flag
### Parameter: `roleAssignments`
-Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
+Array of role assignments to create.
- Required: No
- Type: array
@@ -1246,7 +1250,7 @@ Array of role assignment objects that contain the 'roleDefinitionIdOrName' and '
| [`description`](#parameter-roleassignmentsdescription) | No | string | Optional. The description of the role assignment. |
| [`principalId`](#parameter-roleassignmentsprincipalid) | Yes | string | Required. The principal ID of the principal (user/group/identity) to assign the role to. |
| [`principalType`](#parameter-roleassignmentsprincipaltype) | No | string | Optional. The principal type of the assigned principal ID. |
-| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead. |
+| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
### Parameter: `roleAssignments.condition`
@@ -1294,7 +1298,7 @@ Optional. The principal type of the assigned principal ID.
### Parameter: `roleAssignments.roleDefinitionIdOrName`
-Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.
+Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
- Required: Yes
- Type: string
diff --git a/modules/api-management/service/main.bicep b/modules/api-management/service/main.bicep
index c71fd923f4..9e8142b83f 100644
--- a/modules/api-management/service/main.bicep
+++ b/modules/api-management/service/main.bicep
@@ -51,7 +51,7 @@ param publisherName string
@description('Optional. Undelete API Management Service if it was previously soft-deleted. If this flag is specified and set to True all other properties will be ignored.')
param restore bool = false
-@description('Optional. Array of role assignment objects that contain the \'roleDefinitionIdOrName\' and \'principalId\' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
+@description('Optional. Array of role assignments to create.')
param roleAssignments roleAssignmentType
@description('Optional. The pricing tier of this API Management service.')
@@ -430,7 +430,7 @@ resource service_diagnosticSettings 'Microsoft.Insights/diagnosticSettings@2021-
resource service_roleAssignments 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for (roleAssignment, index) in (roleAssignments ?? []): {
name: guid(service.id, roleAssignment.principalId, roleAssignment.roleDefinitionIdOrName)
properties: {
- roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : roleAssignment.roleDefinitionIdOrName
+ roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : contains(roleAssignment.roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/') ? roleAssignment.roleDefinitionIdOrName : subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleAssignment.roleDefinitionIdOrName)
principalId: roleAssignment.principalId
description: roleAssignment.?description
principalType: roleAssignment.?principalType
@@ -477,7 +477,7 @@ type lockType = {
}?
type roleAssignmentType = {
- @description('Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.')
+ @description('Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
roleDefinitionIdOrName: string
@description('Required. The principal ID of the principal (user/group/identity) to assign the role to.')
diff --git a/modules/api-management/service/main.json b/modules/api-management/service/main.json
index 4331c55f43..bb97234fb2 100644
--- a/modules/api-management/service/main.json
+++ b/modules/api-management/service/main.json
@@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
- "templateHash": "12034021056308380039"
+ "templateHash": "12791748357960289440"
},
"name": "API Management Services",
"description": "This module deploys an API Management Service.",
@@ -69,7 +69,7 @@
"roleDefinitionIdOrName": {
"type": "string",
"metadata": {
- "description": "Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead."
+ "description": "Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
}
},
"principalId": {
@@ -346,7 +346,7 @@
"roleAssignments": {
"$ref": "#/definitions/roleAssignmentType",
"metadata": {
- "description": "Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
+ "description": "Optional. Array of role assignments to create."
}
},
"sku": {
@@ -605,7 +605,7 @@
"scope": "[format('Microsoft.ApiManagement/service/{0}', parameters('name'))]",
"name": "[guid(resourceId('Microsoft.ApiManagement/service', parameters('name')), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId, coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
"properties": {
- "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
+ "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], if(contains(coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)))]",
"principalId": "[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId]",
"description": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'description')]",
"principalType": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'principalType')]",
diff --git a/modules/api-management/service/tests/e2e/max/main.test.bicep b/modules/api-management/service/tests/e2e/max/main.test.bicep
index 609d61a44b..5a03a93afb 100644
--- a/modules/api-management/service/tests/e2e/max/main.test.bicep
+++ b/modules/api-management/service/tests/e2e/max/main.test.bicep
@@ -194,7 +194,17 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
]
roleAssignments: [
{
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')
principalId: nestedDependencies.outputs.managedIdentityPrincipalId
principalType: 'ServicePrincipal'
}
diff --git a/modules/api-management/service/tests/e2e/waf-aligned/main.test.bicep b/modules/api-management/service/tests/e2e/waf-aligned/main.test.bicep
index a722f02c9d..497fa84bc5 100644
--- a/modules/api-management/service/tests/e2e/waf-aligned/main.test.bicep
+++ b/modules/api-management/service/tests/e2e/waf-aligned/main.test.bicep
@@ -192,13 +192,6 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
subscriptionRequired: false
}
]
- roleAssignments: [
- {
- roleDefinitionIdOrName: 'Reader'
- principalId: nestedDependencies.outputs.managedIdentityPrincipalId
- principalType: 'ServicePrincipal'
- }
- ]
subscriptions: [
{
name: 'testArmSubscriptionAllApis'
diff --git a/modules/app-configuration/configuration-store/README.md b/modules/app-configuration/configuration-store/README.md
index 1913e261cd..990cfe2b51 100644
--- a/modules/app-configuration/configuration-store/README.md
+++ b/modules/app-configuration/configuration-store/README.md
@@ -129,7 +129,17 @@ module configurationStore 'br:bicep/modules/app-configuration.configuration-stor
{
principalId: ''
principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: ''
}
]
softDeleteRetentionInDays: 1
@@ -206,7 +216,17 @@ module configurationStore 'br:bicep/modules/app-configuration.configuration-stor
{
"principalId": "",
"principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
+ "roleDefinitionIdOrName": "Owner"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": "b24988ac-6180-42a0-ab88-20f7382dd24c"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": ""
}
]
},
@@ -289,7 +309,17 @@ module configurationStore 'br:bicep/modules/app-configuration.configuration-stor
{
principalId: ''
principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: ''
}
]
softDeleteRetentionInDays: 1
@@ -382,7 +412,17 @@ module configurationStore 'br:bicep/modules/app-configuration.configuration-stor
{
"principalId": "",
"principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
+ "roleDefinitionIdOrName": "Owner"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": "b24988ac-6180-42a0-ab88-20f7382dd24c"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": ""
}
]
},
@@ -562,13 +602,6 @@ module configurationStore 'br:bicep/modules/app-configuration.configuration-stor
''
]
}
- roleAssignments: [
- {
- principalId: ''
- principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
- }
- ]
softDeleteRetentionInDays: 1
tags: {
Environment: 'Non-Prod'
@@ -654,15 +687,6 @@ module configurationStore 'br:bicep/modules/app-configuration.configuration-stor
]
}
},
- "roleAssignments": {
- "value": [
- {
- "principalId": "",
- "principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
- }
- ]
- },
"softDeleteRetentionInDays": {
"value": 1
},
@@ -705,7 +729,7 @@ module configurationStore 'br:bicep/modules/app-configuration.configuration-stor
| [`managedIdentities`](#parameter-managedidentities) | object | The managed identity definition for this resource. |
| [`privateEndpoints`](#parameter-privateendpoints) | array | Configuration details for private endpoints. For security reasons, it is recommended to use private endpoints whenever possible. |
| [`publicNetworkAccess`](#parameter-publicnetworkaccess) | string | Whether or not public network access is allowed for this resource. For security reasons it should be disabled. If not specified, it will be disabled by default if private endpoints are set. |
-| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
+| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignments to create. |
| [`sku`](#parameter-sku) | string | Pricing tier of App Configuration. |
| [`softDeleteRetentionInDays`](#parameter-softdeleteretentionindays) | int | The amount of time in days that the configuration store will be retained when it is soft deleted. |
| [`tags`](#parameter-tags) | object | Tags of the resource. |
@@ -995,7 +1019,7 @@ Configuration details for private endpoints. For security reasons, it is recomme
| [`name`](#parameter-privateendpointsname) | No | string | Optional. The name of the private endpoint. |
| [`privateDnsZoneGroupName`](#parameter-privateendpointsprivatednszonegroupname) | No | string | Optional. The name of the private DNS zone group to create if privateDnsZoneResourceIds were provided. |
| [`privateDnsZoneResourceIds`](#parameter-privateendpointsprivatednszoneresourceids) | No | array | Optional. The private DNS zone groups to associate the private endpoint with. A DNS zone group can support up to 5 DNS zones. |
-| [`roleAssignments`](#parameter-privateendpointsroleassignments) | No | array | Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
+| [`roleAssignments`](#parameter-privateendpointsroleassignments) | No | array | Optional. Array of role assignments to create. |
| [`service`](#parameter-privateendpointsservice) | No | string | Optional. The service (sub-) type to deploy the private endpoint for. For example "vault" or "blob". |
| [`subnetResourceId`](#parameter-privateendpointssubnetresourceid) | Yes | string | Required. Resource ID of the subnet where the endpoint needs to be created. |
| [`tags`](#parameter-privateendpointstags) | No | object | Optional. Tags to be applied on all resources/resource groups in this deployment. |
@@ -1147,7 +1171,7 @@ Optional. The private DNS zone groups to associate the private endpoint with. A
### Parameter: `privateEndpoints.roleAssignments`
-Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
+Optional. Array of role assignments to create.
- Required: No
- Type: array
@@ -1190,7 +1214,7 @@ Whether or not public network access is allowed for this resource. For security
### Parameter: `roleAssignments`
-Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
+Array of role assignments to create.
- Required: No
- Type: array
@@ -1203,7 +1227,7 @@ Array of role assignment objects that contain the 'roleDefinitionIdOrName' and '
| [`description`](#parameter-roleassignmentsdescription) | No | string | Optional. The description of the role assignment. |
| [`principalId`](#parameter-roleassignmentsprincipalid) | Yes | string | Required. The principal ID of the principal (user/group/identity) to assign the role to. |
| [`principalType`](#parameter-roleassignmentsprincipaltype) | No | string | Optional. The principal type of the assigned principal ID. |
-| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead. |
+| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
### Parameter: `roleAssignments.condition`
@@ -1251,7 +1275,7 @@ Optional. The principal type of the assigned principal ID.
### Parameter: `roleAssignments.roleDefinitionIdOrName`
-Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.
+Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
- Required: Yes
- Type: string
diff --git a/modules/app-configuration/configuration-store/main.bicep b/modules/app-configuration/configuration-store/main.bicep
index 68dd210d37..f4bc48c14c 100644
--- a/modules/app-configuration/configuration-store/main.bicep
+++ b/modules/app-configuration/configuration-store/main.bicep
@@ -56,7 +56,7 @@ param diagnosticSettings diagnosticSettingType
@description('Optional. The lock settings of the service.')
param lock lockType
-@description('Optional. Array of role assignment objects that contain the \'roleDefinitionIdOrName\' and \'principalId\' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
+@description('Optional. Array of role assignments to create.')
param roleAssignments roleAssignmentType
@description('Optional. Tags of the resource.')
@@ -188,7 +188,7 @@ resource configurationStore_diagnosticSettings 'Microsoft.Insights/diagnosticSet
resource configurationStore_roleAssignments 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for (roleAssignment, index) in (roleAssignments ?? []): {
name: guid(configurationStore.id, roleAssignment.principalId, roleAssignment.roleDefinitionIdOrName)
properties: {
- roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : roleAssignment.roleDefinitionIdOrName
+ roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : contains(roleAssignment.roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/') ? roleAssignment.roleDefinitionIdOrName : subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleAssignment.roleDefinitionIdOrName)
principalId: roleAssignment.principalId
description: roleAssignment.?description
principalType: roleAssignment.?principalType
@@ -259,7 +259,7 @@ type lockType = {
}?
type roleAssignmentType = {
- @description('Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.')
+ @description('Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
roleDefinitionIdOrName: string
@description('Required. The principal ID of the principal (user/group/identity) to assign the role to.')
@@ -336,7 +336,7 @@ type privateEndpointType = {
@description('Optional. Specify the type of lock.')
lock: lockType
- @description('Optional. Array of role assignment objects that contain the \'roleDefinitionIdOrName\' and \'principalId\' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
+ @description('Optional. Array of role assignments to create.')
roleAssignments: roleAssignmentType
@description('Optional. Tags to be applied on all resources/resource groups in this deployment.')
diff --git a/modules/app-configuration/configuration-store/main.json b/modules/app-configuration/configuration-store/main.json
index f3f2d4fd17..8356549175 100644
--- a/modules/app-configuration/configuration-store/main.json
+++ b/modules/app-configuration/configuration-store/main.json
@@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
- "templateHash": "75945570727927214"
+ "templateHash": "1035721071234192840"
},
"name": "App Configuration Stores",
"description": "This module deploys an App Configuration Store.",
@@ -69,7 +69,7 @@
"roleDefinitionIdOrName": {
"type": "string",
"metadata": {
- "description": "Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead."
+ "description": "Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
}
},
"principalId": {
@@ -274,7 +274,7 @@
"roleAssignments": {
"$ref": "#/definitions/roleAssignmentType",
"metadata": {
- "description": "Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
+ "description": "Optional. Array of role assignments to create."
}
},
"tags": {
@@ -546,7 +546,7 @@
"roleAssignments": {
"$ref": "#/definitions/roleAssignmentType",
"metadata": {
- "description": "Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
+ "description": "Optional. Array of role assignments to create."
}
},
"tags": {
@@ -701,7 +701,7 @@
"scope": "[format('Microsoft.AppConfiguration/configurationStores/{0}', parameters('name'))]",
"name": "[guid(resourceId('Microsoft.AppConfiguration/configurationStores', parameters('name')), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId, coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
"properties": {
- "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
+ "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], if(contains(coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)))]",
"principalId": "[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId]",
"description": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'description')]",
"principalType": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'principalType')]",
diff --git a/modules/app-configuration/configuration-store/tests/e2e/encr/main.test.bicep b/modules/app-configuration/configuration-store/tests/e2e/encr/main.test.bicep
index df73c1e7d6..8c676e3be7 100644
--- a/modules/app-configuration/configuration-store/tests/e2e/encr/main.test.bicep
+++ b/modules/app-configuration/configuration-store/tests/e2e/encr/main.test.bicep
@@ -75,7 +75,17 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
]
roleAssignments: [
{
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')
principalId: nestedDependencies.outputs.managedIdentityPrincipalId
principalType: 'ServicePrincipal'
}
diff --git a/modules/app-configuration/configuration-store/tests/e2e/max/main.test.bicep b/modules/app-configuration/configuration-store/tests/e2e/max/main.test.bicep
index f3f76a3b95..a3bba846cd 100644
--- a/modules/app-configuration/configuration-store/tests/e2e/max/main.test.bicep
+++ b/modules/app-configuration/configuration-store/tests/e2e/max/main.test.bicep
@@ -104,7 +104,17 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
}
roleAssignments: [
{
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')
principalId: nestedDependencies.outputs.managedIdentityPrincipalId
principalType: 'ServicePrincipal'
}
diff --git a/modules/app-configuration/configuration-store/tests/e2e/waf-aligned/main.test.bicep b/modules/app-configuration/configuration-store/tests/e2e/waf-aligned/main.test.bicep
index d5aa0ab214..11ffe42dcc 100644
--- a/modules/app-configuration/configuration-store/tests/e2e/waf-aligned/main.test.bicep
+++ b/modules/app-configuration/configuration-store/tests/e2e/waf-aligned/main.test.bicep
@@ -102,13 +102,6 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
kind: 'CanNotDelete'
name: 'myCustomLockName'
}
- roleAssignments: [
- {
- roleDefinitionIdOrName: 'Reader'
- principalId: nestedDependencies.outputs.managedIdentityPrincipalId
- principalType: 'ServicePrincipal'
- }
- ]
softDeleteRetentionInDays: 1
managedIdentities: {
systemAssigned: true
diff --git a/modules/app/container-app/README.md b/modules/app/container-app/README.md
index a5789ffb6c..6f88154a11 100644
--- a/modules/app/container-app/README.md
+++ b/modules/app/container-app/README.md
@@ -694,7 +694,7 @@ Array of role assignment objects that contain the 'roleDefinitionIdOrName' and '
| [`description`](#parameter-roleassignmentsdescription) | No | string | Optional. The description of the role assignment. |
| [`principalId`](#parameter-roleassignmentsprincipalid) | Yes | string | Required. The principal ID of the principal (user/group/identity) to assign the role to. |
| [`principalType`](#parameter-roleassignmentsprincipaltype) | No | string | Optional. The principal type of the assigned principal ID. |
-| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead. |
+| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
### Parameter: `roleAssignments.condition`
@@ -742,7 +742,7 @@ Optional. The principal type of the assigned principal ID.
### Parameter: `roleAssignments.roleDefinitionIdOrName`
-Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.
+Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
- Required: Yes
- Type: string
diff --git a/modules/app/container-app/main.bicep b/modules/app/container-app/main.bicep
index 2ba53033af..939f2bed5c 100644
--- a/modules/app/container-app/main.bicep
+++ b/modules/app/container-app/main.bicep
@@ -197,7 +197,7 @@ resource containerApp_lock 'Microsoft.Authorization/locks@2020-05-01' = if (!emp
resource containerApp_roleAssignments 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for (roleAssignment, index) in (roleAssignments ?? []): {
name: guid(containerApp.id, roleAssignment.principalId, roleAssignment.roleDefinitionIdOrName)
properties: {
- roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : roleAssignment.roleDefinitionIdOrName
+ roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : contains(roleAssignment.roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/') ? roleAssignment.roleDefinitionIdOrName : subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleAssignment.roleDefinitionIdOrName)
principalId: roleAssignment.principalId
description: roleAssignment.?description
principalType: roleAssignment.?principalType
@@ -244,7 +244,7 @@ type lockType = {
}?
type roleAssignmentType = {
- @description('Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.')
+ @description('Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
roleDefinitionIdOrName: string
@description('Required. The principal ID of the principal (user/group/identity) to assign the role to.')
diff --git a/modules/app/container-app/main.json b/modules/app/container-app/main.json
index 3e89b56a68..151294bb80 100644
--- a/modules/app/container-app/main.json
+++ b/modules/app/container-app/main.json
@@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
- "templateHash": "3901132801605374235"
+ "templateHash": "3664175856787955387"
},
"name": "Container Apps",
"description": "This module deploys a Container App.",
@@ -69,7 +69,7 @@
"roleDefinitionIdOrName": {
"type": "string",
"metadata": {
- "description": "Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead."
+ "description": "Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
}
},
"principalId": {
@@ -457,7 +457,7 @@
"scope": "[format('Microsoft.App/containerApps/{0}', parameters('name'))]",
"name": "[guid(resourceId('Microsoft.App/containerApps', parameters('name')), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId, coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
"properties": {
- "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
+ "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], if(contains(coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)))]",
"principalId": "[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId]",
"description": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'description')]",
"principalType": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'principalType')]",
diff --git a/modules/app/job/README.md b/modules/app/job/README.md
index c1201754ba..cd12e8e51d 100644
--- a/modules/app/job/README.md
+++ b/modules/app/job/README.md
@@ -687,7 +687,7 @@ Array of role assignment objects that contain the 'roleDefinitionIdOrName' and '
| [`description`](#parameter-roleassignmentsdescription) | No | string | Optional. The description of the role assignment. |
| [`principalId`](#parameter-roleassignmentsprincipalid) | Yes | string | Required. The principal ID of the principal (user/group/identity) to assign the role to. |
| [`principalType`](#parameter-roleassignmentsprincipaltype) | No | string | Optional. The principal type of the assigned principal ID. |
-| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead. |
+| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
### Parameter: `roleAssignments.condition`
@@ -735,7 +735,7 @@ Optional. The principal type of the assigned principal ID.
### Parameter: `roleAssignments.roleDefinitionIdOrName`
-Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.
+Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
- Required: Yes
- Type: string
diff --git a/modules/app/job/main.bicep b/modules/app/job/main.bicep
index ee9795e632..15d8106352 100644
--- a/modules/app/job/main.bicep
+++ b/modules/app/job/main.bicep
@@ -135,7 +135,7 @@ resource containerAppJob_lock 'Microsoft.Authorization/locks@2020-05-01' = if (!
resource containerAppJob_roleAssignments 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for (roleAssignment, index) in (roleAssignments ?? []): {
name: guid(containerAppJob.id, roleAssignment.principalId, roleAssignment.roleDefinitionIdOrName)
properties: {
- roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : roleAssignment.roleDefinitionIdOrName
+ roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : contains(roleAssignment.roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/') ? roleAssignment.roleDefinitionIdOrName : subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleAssignment.roleDefinitionIdOrName)
principalId: roleAssignment.principalId
description: roleAssignment.?description
principalType: roleAssignment.?principalType
@@ -174,7 +174,7 @@ type lockType = {
}?
type roleAssignmentType = {
- @description('Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.')
+ @description('Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
roleDefinitionIdOrName: string
@description('Required. The principal ID of the principal (user/group/identity) to assign the role to.')
diff --git a/modules/app/job/main.json b/modules/app/job/main.json
index 47a3c78d1e..2913e527df 100644
--- a/modules/app/job/main.json
+++ b/modules/app/job/main.json
@@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
- "templateHash": "1177002150217044728"
+ "templateHash": "5076851392653441401"
},
"name": "Container App Jobs",
"description": "This module deploys a Container App Job.",
@@ -46,7 +46,7 @@
"roleDefinitionIdOrName": {
"type": "string",
"metadata": {
- "description": "Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead."
+ "description": "Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
}
},
"principalId": {
@@ -347,7 +347,7 @@
"scope": "[format('Microsoft.App/jobs/{0}', parameters('name'))]",
"name": "[guid(resourceId('Microsoft.App/jobs', parameters('name')), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId, coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
"properties": {
- "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
+ "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], if(contains(coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)))]",
"principalId": "[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId]",
"description": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'description')]",
"principalType": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'principalType')]",
diff --git a/modules/app/managed-environment/README.md b/modules/app/managed-environment/README.md
index d222427925..913062b3a2 100644
--- a/modules/app/managed-environment/README.md
+++ b/modules/app/managed-environment/README.md
@@ -313,7 +313,7 @@ module managedEnvironment 'br:bicep/modules/app.managed-environment:1.0.0' = {
| [`logsDestination`](#parameter-logsdestination) | string | Logs destination. |
| [`platformReservedCidr`](#parameter-platformreservedcidr) | string | IP range in CIDR notation that can be reserved for environment infrastructure IP addresses. It must not overlap with any other provided IP ranges and can only be used when the environment is deployed into a virtual network. If not provided, it will be set with a default value by the platform. |
| [`platformReservedDnsIP`](#parameter-platformreserveddnsip) | string | An IP address from the IP range defined by "platformReservedCidr" that will be reserved for the internal DNS server. It must not be the first address in the range and can only be used when the environment is deployed into a virtual network. If not provided, it will be set with a default value by the platform. |
-| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
+| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignments to create. |
| [`skuName`](#parameter-skuname) | string | Managed environment SKU. |
| [`tags`](#parameter-tags) | object | Tags of the resource. |
| [`workloadProfiles`](#parameter-workloadprofiles) | array | Workload profiles configured for the Managed Environment. |
@@ -450,7 +450,7 @@ An IP address from the IP range defined by "platformReservedCidr" that will be r
### Parameter: `roleAssignments`
-Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
+Array of role assignments to create.
- Required: No
- Type: array
@@ -463,7 +463,7 @@ Array of role assignment objects that contain the 'roleDefinitionIdOrName' and '
| [`description`](#parameter-roleassignmentsdescription) | No | string | Optional. The description of the role assignment. |
| [`principalId`](#parameter-roleassignmentsprincipalid) | Yes | string | Required. The principal ID of the principal (user/group/identity) to assign the role to. |
| [`principalType`](#parameter-roleassignmentsprincipaltype) | No | string | Optional. The principal type of the assigned principal ID. |
-| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead. |
+| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
### Parameter: `roleAssignments.condition`
@@ -511,7 +511,7 @@ Optional. The principal type of the assigned principal ID.
### Parameter: `roleAssignments.roleDefinitionIdOrName`
-Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.
+Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
- Required: Yes
- Type: string
diff --git a/modules/app/managed-environment/main.bicep b/modules/app/managed-environment/main.bicep
index 12fc9772c4..f3905ce986 100644
--- a/modules/app/managed-environment/main.bicep
+++ b/modules/app/managed-environment/main.bicep
@@ -14,7 +14,7 @@ param location string = resourceGroup().location
@description('Optional. Tags of the resource.')
param tags object?
-@description('Optional. Array of role assignment objects that contain the \'roleDefinitionIdOrName\' and \'principalId\' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
+@description('Optional. Array of role assignments to create.')
param roleAssignments roleAssignmentType
@allowed([
@@ -135,7 +135,7 @@ resource managedEnvironment 'Microsoft.App/managedEnvironments@2022-10-01' = {
resource managedEnvironment_roleAssignments 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for (roleAssignment, index) in (roleAssignments ?? []): {
name: guid(managedEnvironment.id, roleAssignment.principalId, roleAssignment.roleDefinitionIdOrName)
properties: {
- roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : roleAssignment.roleDefinitionIdOrName
+ roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : contains(roleAssignment.roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/') ? roleAssignment.roleDefinitionIdOrName : subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleAssignment.roleDefinitionIdOrName)
principalId: roleAssignment.principalId
description: roleAssignment.?description
principalType: roleAssignment.?principalType
@@ -180,7 +180,7 @@ type lockType = {
}?
type roleAssignmentType = {
- @description('Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.')
+ @description('Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
roleDefinitionIdOrName: string
@description('Required. The principal ID of the principal (user/group/identity) to assign the role to.')
diff --git a/modules/app/managed-environment/main.json b/modules/app/managed-environment/main.json
index cd7af31c94..ba37943c32 100644
--- a/modules/app/managed-environment/main.json
+++ b/modules/app/managed-environment/main.json
@@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
- "templateHash": "17510800738142190994"
+ "templateHash": "15830956831455159038"
},
"name": "App ManagedEnvironments",
"description": "This module deploys an App Managed Environment (also known as a Container App Environment).",
@@ -46,7 +46,7 @@
"roleDefinitionIdOrName": {
"type": "string",
"metadata": {
- "description": "Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead."
+ "description": "Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
}
},
"principalId": {
@@ -135,7 +135,7 @@
"roleAssignments": {
"$ref": "#/definitions/roleAssignmentType",
"metadata": {
- "description": "Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
+ "description": "Optional. Array of role assignments to create."
}
},
"skuName": {
@@ -334,7 +334,7 @@
"scope": "[format('Microsoft.App/managedEnvironments/{0}', parameters('name'))]",
"name": "[guid(resourceId('Microsoft.App/managedEnvironments', parameters('name')), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId, coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
"properties": {
- "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
+ "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], if(contains(coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)))]",
"principalId": "[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId]",
"description": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'description')]",
"principalType": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'principalType')]",
diff --git a/modules/automation/automation-account/README.md b/modules/automation/automation-account/README.md
index 11b5cc06c2..fb894b62e8 100644
--- a/modules/automation/automation-account/README.md
+++ b/modules/automation/automation-account/README.md
@@ -252,7 +252,17 @@ module automationAccount 'br:bicep/modules/automation.automation-account:1.0.0'
{
principalId: ''
principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: ''
}
]
runbooks: [
@@ -484,7 +494,17 @@ module automationAccount 'br:bicep/modules/automation.automation-account:1.0.0'
{
"principalId": "",
"principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
+ "roleDefinitionIdOrName": "Owner"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": "b24988ac-6180-42a0-ab88-20f7382dd24c"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": ""
}
]
},
@@ -704,13 +724,6 @@ module automationAccount 'br:bicep/modules/automation.automation-account:1.0.0'
}
}
]
- roleAssignments: [
- {
- principalId: ''
- principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
- }
- ]
runbooks: [
{
description: 'Test runbook'
@@ -935,15 +948,6 @@ module automationAccount 'br:bicep/modules/automation.automation-account:1.0.0'
}
]
},
- "roleAssignments": {
- "value": [
- {
- "principalId": "",
- "principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
- }
- ]
- },
"runbooks": {
"value": [
{
@@ -1097,7 +1101,7 @@ module automationAccount 'br:bicep/modules/automation.automation-account:1.0.0'
| [`modules`](#parameter-modules) | array | List of modules to be created in the automation account. |
| [`privateEndpoints`](#parameter-privateendpoints) | array | Configuration details for private endpoints. For security reasons, it is recommended to use private endpoints whenever possible. |
| [`publicNetworkAccess`](#parameter-publicnetworkaccess) | string | Whether or not public network access is allowed for this resource. For security reasons it should be disabled. If not specified, it will be disabled by default if private endpoints are set. |
-| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
+| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignments to create. |
| [`runbooks`](#parameter-runbooks) | array | List of runbooks to be created in the automation account. |
| [`schedules`](#parameter-schedules) | array | List of schedules to be created in the automation account. |
| [`skuName`](#parameter-skuname) | string | SKU name of the account. |
@@ -1390,7 +1394,7 @@ Configuration details for private endpoints. For security reasons, it is recomme
| [`name`](#parameter-privateendpointsname) | No | string | Optional. The name of the private endpoint. |
| [`privateDnsZoneGroupName`](#parameter-privateendpointsprivatednszonegroupname) | No | string | Optional. The name of the private DNS zone group to create if privateDnsZoneResourceIds were provided. |
| [`privateDnsZoneResourceIds`](#parameter-privateendpointsprivatednszoneresourceids) | No | array | Optional. The private DNS zone groups to associate the private endpoint with. A DNS zone group can support up to 5 DNS zones. |
-| [`roleAssignments`](#parameter-privateendpointsroleassignments) | No | array | Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
+| [`roleAssignments`](#parameter-privateendpointsroleassignments) | No | array | Optional. Array of role assignments to create. |
| [`service`](#parameter-privateendpointsservice) | Yes | string | Required. The service (sub-) type to deploy the private endpoint for. For example "vault" or "blob". |
| [`subnetResourceId`](#parameter-privateendpointssubnetresourceid) | Yes | string | Required. Resource ID of the subnet where the endpoint needs to be created. |
| [`tags`](#parameter-privateendpointstags) | No | object | Optional. Tags to be applied on all resources/resource groups in this deployment. |
@@ -1542,7 +1546,7 @@ Optional. The private DNS zone groups to associate the private endpoint with. A
### Parameter: `privateEndpoints.roleAssignments`
-Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
+Optional. Array of role assignments to create.
- Required: No
- Type: array
@@ -1585,7 +1589,7 @@ Whether or not public network access is allowed for this resource. For security
### Parameter: `roleAssignments`
-Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
+Array of role assignments to create.
- Required: No
- Type: array
@@ -1598,7 +1602,7 @@ Array of role assignment objects that contain the 'roleDefinitionIdOrName' and '
| [`description`](#parameter-roleassignmentsdescription) | No | string | Optional. The description of the role assignment. |
| [`principalId`](#parameter-roleassignmentsprincipalid) | Yes | string | Required. The principal ID of the principal (user/group/identity) to assign the role to. |
| [`principalType`](#parameter-roleassignmentsprincipaltype) | No | string | Optional. The principal type of the assigned principal ID. |
-| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead. |
+| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
### Parameter: `roleAssignments.condition`
@@ -1646,7 +1650,7 @@ Optional. The principal type of the assigned principal ID.
### Parameter: `roleAssignments.roleDefinitionIdOrName`
-Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.
+Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
- Required: Yes
- Type: string
diff --git a/modules/automation/automation-account/main.bicep b/modules/automation/automation-account/main.bicep
index c7c66989e5..a2dfa7b527 100644
--- a/modules/automation/automation-account/main.bicep
+++ b/modules/automation/automation-account/main.bicep
@@ -65,7 +65,7 @@ param managedIdentities managedIdentitiesType
@description('Optional. The lock settings of the service.')
param lock lockType
-@description('Optional. Array of role assignment objects that contain the \'roleDefinitionIdOrName\' and \'principalId\' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
+@description('Optional. Array of role assignments to create.')
param roleAssignments roleAssignmentType
@description('Optional. Tags of the Automation Account resource.')
@@ -361,7 +361,7 @@ module automationAccount_privateEndpoints '../../network/private-endpoint/main.b
resource automationAccount_roleAssignments 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for (roleAssignment, index) in (roleAssignments ?? []): {
name: guid(automationAccount.id, roleAssignment.principalId, roleAssignment.roleDefinitionIdOrName)
properties: {
- roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : roleAssignment.roleDefinitionIdOrName
+ roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : contains(roleAssignment.roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/') ? roleAssignment.roleDefinitionIdOrName : subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleAssignment.roleDefinitionIdOrName)
principalId: roleAssignment.principalId
description: roleAssignment.?description
principalType: roleAssignment.?principalType
@@ -408,7 +408,7 @@ type lockType = {
}?
type roleAssignmentType = {
- @description('Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.')
+ @description('Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
roleDefinitionIdOrName: string
@description('Required. The principal ID of the principal (user/group/identity) to assign the role to.')
@@ -485,7 +485,7 @@ type privateEndpointType = {
@description('Optional. Specify the type of lock.')
lock: lockType
- @description('Optional. Array of role assignment objects that contain the \'roleDefinitionIdOrName\' and \'principalId\' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
+ @description('Optional. Array of role assignments to create.')
roleAssignments: roleAssignmentType
@description('Optional. Tags to be applied on all resources/resource groups in this deployment.')
diff --git a/modules/automation/automation-account/main.json b/modules/automation/automation-account/main.json
index db9ba071f1..369cf74eb5 100644
--- a/modules/automation/automation-account/main.json
+++ b/modules/automation/automation-account/main.json
@@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
- "templateHash": "3971272162822794152"
+ "templateHash": "15622091278066868534"
},
"name": "Automation Accounts",
"description": "This module deploys an Azure Automation Account.",
@@ -69,7 +69,7 @@
"roleDefinitionIdOrName": {
"type": "string",
"metadata": {
- "description": "Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead."
+ "description": "Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
}
},
"principalId": {
@@ -273,7 +273,7 @@
"roleAssignments": {
"$ref": "#/definitions/roleAssignmentType",
"metadata": {
- "description": "Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
+ "description": "Optional. Array of role assignments to create."
}
},
"tags": {
@@ -573,7 +573,7 @@
"roleAssignments": {
"$ref": "#/definitions/roleAssignmentType",
"metadata": {
- "description": "Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
+ "description": "Optional. Array of role assignments to create."
}
},
"tags": {
@@ -719,7 +719,7 @@
"scope": "[format('Microsoft.Automation/automationAccounts/{0}', parameters('name'))]",
"name": "[guid(resourceId('Microsoft.Automation/automationAccounts', parameters('name')), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId, coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
"properties": {
- "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
+ "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], if(contains(coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)))]",
"principalId": "[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId]",
"description": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'description')]",
"principalType": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'principalType')]",
diff --git a/modules/automation/automation-account/tests/e2e/max/main.test.bicep b/modules/automation/automation-account/tests/e2e/max/main.test.bicep
index 4a97bffb39..b77d8bbd82 100644
--- a/modules/automation/automation-account/tests/e2e/max/main.test.bicep
+++ b/modules/automation/automation-account/tests/e2e/max/main.test.bicep
@@ -137,7 +137,17 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
]
roleAssignments: [
{
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')
principalId: nestedDependencies.outputs.managedIdentityPrincipalId
principalType: 'ServicePrincipal'
}
diff --git a/modules/automation/automation-account/tests/e2e/waf-aligned/main.test.bicep b/modules/automation/automation-account/tests/e2e/waf-aligned/main.test.bicep
index f024413f06..e4d4913905 100644
--- a/modules/automation/automation-account/tests/e2e/waf-aligned/main.test.bicep
+++ b/modules/automation/automation-account/tests/e2e/waf-aligned/main.test.bicep
@@ -135,13 +135,6 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
}
}
]
- roleAssignments: [
- {
- roleDefinitionIdOrName: 'Reader'
- principalId: nestedDependencies.outputs.managedIdentityPrincipalId
- principalType: 'ServicePrincipal'
- }
- ]
runbooks: [
{
description: 'Test runbook'
diff --git a/modules/cache/redis-enterprise/README.md b/modules/cache/redis-enterprise/README.md
index 0c37755f50..e818d8120c 100644
--- a/modules/cache/redis-enterprise/README.md
+++ b/modules/cache/redis-enterprise/README.md
@@ -277,7 +277,17 @@ module redisEnterprise 'br:bicep/modules/cache.redis-enterprise:1.0.0' = {
{
principalId: ''
principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: ''
}
]
tags: {
@@ -378,7 +388,17 @@ module redisEnterprise 'br:bicep/modules/cache.redis-enterprise:1.0.0' = {
{
"principalId": "",
"principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
+ "roleDefinitionIdOrName": "Owner"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": "b24988ac-6180-42a0-ab88-20f7382dd24c"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": ""
}
]
},
@@ -467,13 +487,6 @@ module redisEnterprise 'br:bicep/modules/cache.redis-enterprise:1.0.0' = {
}
}
]
- roleAssignments: [
- {
- principalId: ''
- principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
- }
- ]
tags: {
'hidden-title': 'This is visible in the resource name'
resourceType: 'Redis Cache Enterprise'
@@ -567,15 +580,6 @@ module redisEnterprise 'br:bicep/modules/cache.redis-enterprise:1.0.0' = {
}
]
},
- "roleAssignments": {
- "value": [
- {
- "principalId": "",
- "principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
- }
- ]
- },
"tags": {
"value": {
"hidden-title": "This is visible in the resource name",
@@ -613,7 +617,7 @@ module redisEnterprise 'br:bicep/modules/cache.redis-enterprise:1.0.0' = {
| [`lock`](#parameter-lock) | object | The lock settings of the service. |
| [`minimumTlsVersion`](#parameter-minimumtlsversion) | string | Requires clients to use a specified TLS version (or higher) to connect. |
| [`privateEndpoints`](#parameter-privateendpoints) | array | Configuration details for private endpoints. For security reasons, it is recommended to use private endpoints whenever possible. |
-| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
+| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignments to create. |
| [`skuName`](#parameter-skuname) | string | The type of Redis Enterprise Cluster to deploy. |
| [`tags`](#parameter-tags) | object | Tags of the resource. |
| [`zoneRedundant`](#parameter-zoneredundant) | bool | When true, the cluster will be deployed across availability zones. |
@@ -801,7 +805,7 @@ Configuration details for private endpoints. For security reasons, it is recomme
| [`name`](#parameter-privateendpointsname) | No | string | Optional. The name of the private endpoint. |
| [`privateDnsZoneGroupName`](#parameter-privateendpointsprivatednszonegroupname) | No | string | Optional. The name of the private DNS zone group to create if privateDnsZoneResourceIds were provided. |
| [`privateDnsZoneResourceIds`](#parameter-privateendpointsprivatednszoneresourceids) | No | array | Optional. The private DNS zone groups to associate the private endpoint with. A DNS zone group can support up to 5 DNS zones. |
-| [`roleAssignments`](#parameter-privateendpointsroleassignments) | No | array | Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
+| [`roleAssignments`](#parameter-privateendpointsroleassignments) | No | array | Optional. Array of role assignments to create. |
| [`service`](#parameter-privateendpointsservice) | No | string | Optional. The service (sub-) type to deploy the private endpoint for. For example "vault" or "blob". |
| [`subnetResourceId`](#parameter-privateendpointssubnetresourceid) | Yes | string | Required. Resource ID of the subnet where the endpoint needs to be created. |
| [`tags`](#parameter-privateendpointstags) | No | object | Optional. Tags to be applied on all resources/resource groups in this deployment. |
@@ -953,7 +957,7 @@ Optional. The private DNS zone groups to associate the private endpoint with. A
### Parameter: `privateEndpoints.roleAssignments`
-Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
+Optional. Array of role assignments to create.
- Required: No
- Type: array
@@ -981,7 +985,7 @@ Optional. Tags to be applied on all resources/resource groups in this deployment
### Parameter: `roleAssignments`
-Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
+Array of role assignments to create.
- Required: No
- Type: array
@@ -994,7 +998,7 @@ Array of role assignment objects that contain the 'roleDefinitionIdOrName' and '
| [`description`](#parameter-roleassignmentsdescription) | No | string | Optional. The description of the role assignment. |
| [`principalId`](#parameter-roleassignmentsprincipalid) | Yes | string | Required. The principal ID of the principal (user/group/identity) to assign the role to. |
| [`principalType`](#parameter-roleassignmentsprincipaltype) | No | string | Optional. The principal type of the assigned principal ID. |
-| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead. |
+| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
### Parameter: `roleAssignments.condition`
@@ -1042,7 +1046,7 @@ Optional. The principal type of the assigned principal ID.
### Parameter: `roleAssignments.roleDefinitionIdOrName`
-Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.
+Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
- Required: Yes
- Type: string
diff --git a/modules/cache/redis-enterprise/main.bicep b/modules/cache/redis-enterprise/main.bicep
index 1be629fba1..cdc3b5a490 100644
--- a/modules/cache/redis-enterprise/main.bicep
+++ b/modules/cache/redis-enterprise/main.bicep
@@ -11,7 +11,7 @@ param name string
@description('Optional. The lock settings of the service.')
param lock lockType
-@description('Optional. Array of role assignment objects that contain the \'roleDefinitionIdOrName\' and \'principalId\' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
+@description('Optional. Array of role assignments to create.')
param roleAssignments roleAssignmentType
@description('Optional. Tags of the resource.')
@@ -126,7 +126,7 @@ resource redisEnterprise_diagnosticSettings 'Microsoft.Insights/diagnosticSettin
resource redisEnterprise_roleAssignments 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for (roleAssignment, index) in (roleAssignments ?? []): {
name: guid(redisEnterprise.id, roleAssignment.principalId, roleAssignment.roleDefinitionIdOrName)
properties: {
- roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : roleAssignment.roleDefinitionIdOrName
+ roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : contains(roleAssignment.roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/') ? roleAssignment.roleDefinitionIdOrName : subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleAssignment.roleDefinitionIdOrName)
principalId: roleAssignment.principalId
description: roleAssignment.?description
principalType: roleAssignment.?principalType
@@ -208,7 +208,7 @@ type lockType = {
}?
type roleAssignmentType = {
- @description('Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.')
+ @description('Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
roleDefinitionIdOrName: string
@description('Required. The principal ID of the principal (user/group/identity) to assign the role to.')
@@ -285,7 +285,7 @@ type privateEndpointType = {
@description('Optional. Specify the type of lock.')
lock: lockType
- @description('Optional. Array of role assignment objects that contain the \'roleDefinitionIdOrName\' and \'principalId\' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
+ @description('Optional. Array of role assignments to create.')
roleAssignments: roleAssignmentType
@description('Optional. Tags to be applied on all resources/resource groups in this deployment.')
diff --git a/modules/cache/redis-enterprise/main.json b/modules/cache/redis-enterprise/main.json
index 27f647f9e5..07490f41f9 100644
--- a/modules/cache/redis-enterprise/main.json
+++ b/modules/cache/redis-enterprise/main.json
@@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
- "templateHash": "9202709558148407604"
+ "templateHash": "14212744208009857353"
},
"name": "Redis Cache Enterprise",
"description": "This module deploys a Redis Cache Enterprise.",
@@ -46,7 +46,7 @@
"roleDefinitionIdOrName": {
"type": "string",
"metadata": {
- "description": "Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead."
+ "description": "Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
}
},
"principalId": {
@@ -251,7 +251,7 @@
"roleAssignments": {
"$ref": "#/definitions/roleAssignmentType",
"metadata": {
- "description": "Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
+ "description": "Optional. Array of role assignments to create."
}
},
"tags": {
@@ -383,7 +383,7 @@
"roleAssignments": {
"$ref": "#/definitions/roleAssignmentType",
"metadata": {
- "description": "Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
+ "description": "Optional. Array of role assignments to create."
}
},
"tags": {
@@ -550,7 +550,7 @@
"scope": "[format('Microsoft.Cache/redisEnterprise/{0}', parameters('name'))]",
"name": "[guid(resourceId('Microsoft.Cache/redisEnterprise', parameters('name')), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId, coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
"properties": {
- "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
+ "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], if(contains(coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)))]",
"principalId": "[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId]",
"description": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'description')]",
"principalType": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'principalType')]",
diff --git a/modules/cache/redis-enterprise/tests/e2e/max/main.test.bicep b/modules/cache/redis-enterprise/tests/e2e/max/main.test.bicep
index 11967b6582..baf56e3e5e 100644
--- a/modules/cache/redis-enterprise/tests/e2e/max/main.test.bicep
+++ b/modules/cache/redis-enterprise/tests/e2e/max/main.test.bicep
@@ -89,7 +89,17 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
}
roleAssignments: [
{
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')
principalId: nestedDependencies.outputs.managedIdentityPrincipalId
principalType: 'ServicePrincipal'
}
diff --git a/modules/cache/redis-enterprise/tests/e2e/waf-aligned/main.test.bicep b/modules/cache/redis-enterprise/tests/e2e/waf-aligned/main.test.bicep
index e11f40719a..b9030436a7 100644
--- a/modules/cache/redis-enterprise/tests/e2e/waf-aligned/main.test.bicep
+++ b/modules/cache/redis-enterprise/tests/e2e/waf-aligned/main.test.bicep
@@ -87,13 +87,6 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
kind: 'CanNotDelete'
name: 'myCustomLockName'
}
- roleAssignments: [
- {
- roleDefinitionIdOrName: 'Reader'
- principalId: nestedDependencies.outputs.managedIdentityPrincipalId
- principalType: 'ServicePrincipal'
- }
- ]
minimumTlsVersion: '1.2'
zoneRedundant: true
privateEndpoints: [
diff --git a/modules/cache/redis/README.md b/modules/cache/redis/README.md
index 45e6ec422f..33f02d5c1f 100644
--- a/modules/cache/redis/README.md
+++ b/modules/cache/redis/README.md
@@ -473,7 +473,7 @@ module redis 'br:bicep/modules/cache.redis:1.0.0' = {
| [`redisVersion`](#parameter-redisversion) | string | Redis version. Only major version will be used in PUT/PATCH request with current valid values: (4, 6). |
| [`replicasPerMaster`](#parameter-replicaspermaster) | int | The number of replicas to be created per primary. |
| [`replicasPerPrimary`](#parameter-replicasperprimary) | int | The number of replicas to be created per primary. |
-| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
+| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignments to create. |
| [`shardCount`](#parameter-shardcount) | int | The number of shards to be created on a Premium Cluster Cache. |
| [`skuName`](#parameter-skuname) | string | The type of Redis cache to deploy. |
| [`staticIP`](#parameter-staticip) | string | Static IP address. Optionally, may be specified when deploying a Redis cache inside an existing Azure Virtual Network; auto assigned by default. |
@@ -732,7 +732,7 @@ Configuration details for private endpoints. For security reasons, it is recomme
| [`name`](#parameter-privateendpointsname) | No | string | Optional. The name of the private endpoint. |
| [`privateDnsZoneGroupName`](#parameter-privateendpointsprivatednszonegroupname) | No | string | Optional. The name of the private DNS zone group to create if privateDnsZoneResourceIds were provided. |
| [`privateDnsZoneResourceIds`](#parameter-privateendpointsprivatednszoneresourceids) | No | array | Optional. The private DNS zone groups to associate the private endpoint with. A DNS zone group can support up to 5 DNS zones. |
-| [`roleAssignments`](#parameter-privateendpointsroleassignments) | No | array | Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
+| [`roleAssignments`](#parameter-privateendpointsroleassignments) | No | array | Optional. Array of role assignments to create. |
| [`service`](#parameter-privateendpointsservice) | No | string | Optional. The service (sub-) type to deploy the private endpoint for. For example "vault" or "blob". |
| [`subnetResourceId`](#parameter-privateendpointssubnetresourceid) | Yes | string | Required. Resource ID of the subnet where the endpoint needs to be created. |
| [`tags`](#parameter-privateendpointstags) | No | object | Optional. Tags to be applied on all resources/resource groups in this deployment. |
@@ -884,7 +884,7 @@ Optional. The private DNS zone groups to associate the private endpoint with. A
### Parameter: `privateEndpoints.roleAssignments`
-Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
+Optional. Array of role assignments to create.
- Required: No
- Type: array
@@ -962,7 +962,7 @@ The number of replicas to be created per primary.
### Parameter: `roleAssignments`
-Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
+Array of role assignments to create.
- Required: No
- Type: array
@@ -975,7 +975,7 @@ Array of role assignment objects that contain the 'roleDefinitionIdOrName' and '
| [`description`](#parameter-roleassignmentsdescription) | No | string | Optional. The description of the role assignment. |
| [`principalId`](#parameter-roleassignmentsprincipalid) | Yes | string | Required. The principal ID of the principal (user/group/identity) to assign the role to. |
| [`principalType`](#parameter-roleassignmentsprincipaltype) | No | string | Optional. The principal type of the assigned principal ID. |
-| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead. |
+| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
### Parameter: `roleAssignments.condition`
@@ -1023,7 +1023,7 @@ Optional. The principal type of the assigned principal ID.
### Parameter: `roleAssignments.roleDefinitionIdOrName`
-Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.
+Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
- Required: Yes
- Type: string
diff --git a/modules/cache/redis/main.bicep b/modules/cache/redis/main.bicep
index bb1d2191e5..4a34e577ce 100644
--- a/modules/cache/redis/main.bicep
+++ b/modules/cache/redis/main.bicep
@@ -11,7 +11,7 @@ param name string
@description('Optional. The lock settings of the service.')
param lock lockType
-@description('Optional. Array of role assignment objects that contain the \'roleDefinitionIdOrName\' and \'principalId\' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
+@description('Optional. Array of role assignments to create.')
param roleAssignments roleAssignmentType
@description('Optional. Tags of the resource.')
@@ -201,7 +201,7 @@ resource redis_diagnosticSettings 'Microsoft.Insights/diagnosticSettings@2021-05
resource redis_roleAssignments 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for (roleAssignment, index) in (roleAssignments ?? []): {
name: guid(redis.id, roleAssignment.principalId, roleAssignment.roleDefinitionIdOrName)
properties: {
- roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : roleAssignment.roleDefinitionIdOrName
+ roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : contains(roleAssignment.roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/') ? roleAssignment.roleDefinitionIdOrName : subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleAssignment.roleDefinitionIdOrName)
principalId: roleAssignment.principalId
description: roleAssignment.?description
principalType: roleAssignment.?principalType
@@ -281,7 +281,7 @@ type lockType = {
}?
type roleAssignmentType = {
- @description('Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.')
+ @description('Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
roleDefinitionIdOrName: string
@description('Required. The principal ID of the principal (user/group/identity) to assign the role to.')
@@ -358,7 +358,7 @@ type privateEndpointType = {
@description('Optional. Specify the type of lock.')
lock: lockType
- @description('Optional. Array of role assignment objects that contain the \'roleDefinitionIdOrName\' and \'principalId\' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
+ @description('Optional. Array of role assignments to create.')
roleAssignments: roleAssignmentType
@description('Optional. Tags to be applied on all resources/resource groups in this deployment.')
diff --git a/modules/cache/redis/main.json b/modules/cache/redis/main.json
index f05edb97ec..90b5617b8a 100644
--- a/modules/cache/redis/main.json
+++ b/modules/cache/redis/main.json
@@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
- "templateHash": "7671125906841819197"
+ "templateHash": "10455754336377427456"
},
"name": "Redis Cache",
"description": "This module deploys a Redis Cache.",
@@ -69,7 +69,7 @@
"roleDefinitionIdOrName": {
"type": "string",
"metadata": {
- "description": "Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead."
+ "description": "Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
}
},
"principalId": {
@@ -274,7 +274,7 @@
"roleAssignments": {
"$ref": "#/definitions/roleAssignmentType",
"metadata": {
- "description": "Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
+ "description": "Optional. Array of role assignments to create."
}
},
"tags": {
@@ -432,7 +432,7 @@
"roleAssignments": {
"$ref": "#/definitions/roleAssignmentType",
"metadata": {
- "description": "Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
+ "description": "Optional. Array of role assignments to create."
}
},
"tags": {
@@ -707,7 +707,7 @@
"scope": "[format('Microsoft.Cache/redis/{0}', parameters('name'))]",
"name": "[guid(resourceId('Microsoft.Cache/redis', parameters('name')), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId, coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
"properties": {
- "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
+ "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], if(contains(coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)))]",
"principalId": "[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId]",
"description": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'description')]",
"principalType": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'principalType')]",
diff --git a/modules/cdn/profile/README.md b/modules/cdn/profile/README.md
index 47cbe6ed82..81efa1a9e1 100644
--- a/modules/cdn/profile/README.md
+++ b/modules/cdn/profile/README.md
@@ -105,7 +105,17 @@ module profile 'br:bicep/modules/cdn.profile:1.0.0' = {
{
principalId: ''
principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: ''
}
]
ruleSets: [
@@ -221,7 +231,17 @@ module profile 'br:bicep/modules/cdn.profile:1.0.0' = {
{
"principalId": "",
"principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
+ "roleDefinitionIdOrName": "Owner"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": "b24988ac-6180-42a0-ab88-20f7382dd24c"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": ""
}
]
},
@@ -315,7 +335,17 @@ module profile 'br:bicep/modules/cdn.profile:1.0.0' = {
{
principalId: ''
principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: ''
}
]
}
@@ -394,7 +424,17 @@ module profile 'br:bicep/modules/cdn.profile:1.0.0' = {
{
"principalId": "",
"principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
+ "roleDefinitionIdOrName": "Owner"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": "b24988ac-6180-42a0-ab88-20f7382dd24c"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": ""
}
]
}
@@ -459,13 +499,6 @@ module profile 'br:bicep/modules/cdn.profile:1.0.0' = {
name: 'myCustomLockName'
}
originResponseTimeoutSeconds: 60
- roleAssignments: [
- {
- principalId: ''
- principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
- }
- ]
}
}
```
@@ -536,15 +569,6 @@ module profile 'br:bicep/modules/cdn.profile:1.0.0' = {
},
"originResponseTimeoutSeconds": {
"value": 60
- },
- "roleAssignments": {
- "value": [
- {
- "principalId": "",
- "principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
- }
- ]
}
}
}
@@ -581,7 +605,7 @@ module profile 'br:bicep/modules/cdn.profile:1.0.0' = {
| [`location`](#parameter-location) | string | Location for all Resources. |
| [`lock`](#parameter-lock) | object | The lock settings of the service. |
| [`originResponseTimeoutSeconds`](#parameter-originresponsetimeoutseconds) | int | Send and receive timeout on forwarding request to the origin. |
-| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
+| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignments to create. |
| [`ruleSets`](#parameter-rulesets) | array | Array of rule set objects. |
| [`secrets`](#parameter-secrets) | array | Array of secret objects. |
| [`tags`](#parameter-tags) | object | Endpoint tags. |
@@ -677,7 +701,7 @@ Array of origin group objects. Required if the afdEndpoints is specified.
### Parameter: `roleAssignments`
-Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
+Array of role assignments to create.
- Required: No
- Type: array
@@ -690,7 +714,7 @@ Array of role assignment objects that contain the 'roleDefinitionIdOrName' and '
| [`description`](#parameter-roleassignmentsdescription) | No | string | Optional. The description of the role assignment. |
| [`principalId`](#parameter-roleassignmentsprincipalid) | Yes | string | Required. The principal ID of the principal (user/group/identity) to assign the role to. |
| [`principalType`](#parameter-roleassignmentsprincipaltype) | No | string | Optional. The principal type of the assigned principal ID. |
-| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead. |
+| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
### Parameter: `roleAssignments.condition`
@@ -738,7 +762,7 @@ Optional. The principal type of the assigned principal ID.
### Parameter: `roleAssignments.roleDefinitionIdOrName`
-Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.
+Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
- Required: Yes
- Type: string
diff --git a/modules/cdn/profile/main.bicep b/modules/cdn/profile/main.bicep
index 30ce9173c1..dd7abe44db 100644
--- a/modules/cdn/profile/main.bicep
+++ b/modules/cdn/profile/main.bicep
@@ -56,7 +56,7 @@ param tags object?
@description('Optional. The lock settings of the service.')
param lock lockType
-@description('Optional. Array of role assignment objects that contain the \'roleDefinitionIdOrName\' and \'principalId\' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
+@description('Optional. Array of role assignments to create.')
param roleAssignments roleAssignmentType
@description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).')
@@ -112,7 +112,7 @@ resource profile_lock 'Microsoft.Authorization/locks@2020-05-01' = if (!empty(lo
resource profile_roleAssignments 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for (roleAssignment, index) in (roleAssignments ?? []): {
name: guid(profile.id, roleAssignment.principalId, roleAssignment.roleDefinitionIdOrName)
properties: {
- roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : roleAssignment.roleDefinitionIdOrName
+ roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : contains(roleAssignment.roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/') ? roleAssignment.roleDefinitionIdOrName : subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleAssignment.roleDefinitionIdOrName)
principalId: roleAssignment.principalId
description: roleAssignment.?description
principalType: roleAssignment.?principalType
@@ -238,7 +238,7 @@ type lockType = {
}?
type roleAssignmentType = {
- @description('Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.')
+ @description('Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
roleDefinitionIdOrName: string
@description('Required. The principal ID of the principal (user/group/identity) to assign the role to.')
diff --git a/modules/cdn/profile/main.json b/modules/cdn/profile/main.json
index e8a03d38c8..3b9850f2ef 100644
--- a/modules/cdn/profile/main.json
+++ b/modules/cdn/profile/main.json
@@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
- "templateHash": "17584746093289526242"
+ "templateHash": "9196888550176341860"
},
"name": "CDN Profiles",
"description": "This module deploys a CDN Profile.",
@@ -46,7 +46,7 @@
"roleDefinitionIdOrName": {
"type": "string",
"metadata": {
- "description": "Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead."
+ "description": "Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
}
},
"principalId": {
@@ -212,7 +212,7 @@
"roleAssignments": {
"$ref": "#/definitions/roleAssignmentType",
"metadata": {
- "description": "Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
+ "description": "Optional. Array of role assignments to create."
}
},
"enableDefaultTelemetry": {
@@ -289,7 +289,7 @@
"scope": "[format('Microsoft.Cdn/profiles/{0}', parameters('name'))]",
"name": "[guid(resourceId('Microsoft.Cdn/profiles', parameters('name')), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId, coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
"properties": {
- "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
+ "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], if(contains(coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)))]",
"principalId": "[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId]",
"description": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'description')]",
"principalType": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'principalType')]",
diff --git a/modules/cdn/profile/tests/e2e/afd/main.test.bicep b/modules/cdn/profile/tests/e2e/afd/main.test.bicep
index 9d3e21d539..e9e3864bf9 100644
--- a/modules/cdn/profile/tests/e2e/afd/main.test.bicep
+++ b/modules/cdn/profile/tests/e2e/afd/main.test.bicep
@@ -60,7 +60,17 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
enableDefaultTelemetry: enableDefaultTelemetry
roleAssignments: [
{
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')
principalId: nestedDependencies.outputs.managedIdentityPrincipalId
principalType: 'ServicePrincipal'
}
diff --git a/modules/cdn/profile/tests/e2e/max/main.test.bicep b/modules/cdn/profile/tests/e2e/max/main.test.bicep
index fb18eefa09..85bf8f601d 100644
--- a/modules/cdn/profile/tests/e2e/max/main.test.bicep
+++ b/modules/cdn/profile/tests/e2e/max/main.test.bicep
@@ -93,7 +93,17 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
}
roleAssignments: [
{
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')
principalId: nestedDependencies.outputs.managedIdentityPrincipalId
principalType: 'ServicePrincipal'
}
diff --git a/modules/cdn/profile/tests/e2e/waf-aligned/main.test.bicep b/modules/cdn/profile/tests/e2e/waf-aligned/main.test.bicep
index 00e2285b20..af0c232249 100644
--- a/modules/cdn/profile/tests/e2e/waf-aligned/main.test.bicep
+++ b/modules/cdn/profile/tests/e2e/waf-aligned/main.test.bicep
@@ -91,12 +91,5 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
originGroups: []
geoFilters: []
}
- roleAssignments: [
- {
- roleDefinitionIdOrName: 'Reader'
- principalId: nestedDependencies.outputs.managedIdentityPrincipalId
- principalType: 'ServicePrincipal'
- }
- ]
}
}]
diff --git a/modules/compute/availability-set/README.md b/modules/compute/availability-set/README.md
index b78be7385e..7eb1754df5 100644
--- a/modules/compute/availability-set/README.md
+++ b/modules/compute/availability-set/README.md
@@ -104,7 +104,17 @@ module availabilitySet 'br:bicep/modules/compute.availability-set:1.0.0' = {
{
principalId: ''
principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: ''
}
]
tags: {
@@ -150,7 +160,17 @@ module availabilitySet 'br:bicep/modules/compute.availability-set:1.0.0' = {
{
"principalId": "",
"principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
+ "roleDefinitionIdOrName": "Owner"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": "b24988ac-6180-42a0-ab88-20f7382dd24c"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": ""
}
]
},
@@ -190,13 +210,6 @@ module availabilitySet 'br:bicep/modules/compute.availability-set:1.0.0' = {
name: 'myCustomLockName'
}
proximityPlacementGroupResourceId: ''
- roleAssignments: [
- {
- principalId: ''
- principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
- }
- ]
tags: {
Environment: 'Non-Prod'
'hidden-title': 'This is visible in the resource name'
@@ -235,15 +248,6 @@ module availabilitySet 'br:bicep/modules/compute.availability-set:1.0.0' = {
"proximityPlacementGroupResourceId": {
"value": ""
},
- "roleAssignments": {
- "value": [
- {
- "principalId": "",
- "principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
- }
- ]
- },
"tags": {
"value": {
"Environment": "Non-Prod",
@@ -277,7 +281,7 @@ module availabilitySet 'br:bicep/modules/compute.availability-set:1.0.0' = {
| [`platformFaultDomainCount`](#parameter-platformfaultdomaincount) | int | The number of fault domains to use. |
| [`platformUpdateDomainCount`](#parameter-platformupdatedomaincount) | int | The number of update domains to use. |
| [`proximityPlacementGroupResourceId`](#parameter-proximityplacementgroupresourceid) | string | Resource ID of a proximity placement group. |
-| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
+| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignments to create. |
| [`skuName`](#parameter-skuname) | string | SKU of the availability set.
- Use 'Aligned' for virtual machines with managed disks.- Use 'Classic' for virtual machines with unmanaged disks. |
| [`tags`](#parameter-tags) | object | Tags of the availability set resource. |
@@ -351,7 +355,7 @@ Resource ID of a proximity placement group.
### Parameter: `roleAssignments`
-Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
+Array of role assignments to create.
- Required: No
- Type: array
@@ -364,7 +368,7 @@ Array of role assignment objects that contain the 'roleDefinitionIdOrName' and '
| [`description`](#parameter-roleassignmentsdescription) | No | string | Optional. The description of the role assignment. |
| [`principalId`](#parameter-roleassignmentsprincipalid) | Yes | string | Required. The principal ID of the principal (user/group/identity) to assign the role to. |
| [`principalType`](#parameter-roleassignmentsprincipaltype) | No | string | Optional. The principal type of the assigned principal ID. |
-| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead. |
+| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
### Parameter: `roleAssignments.condition`
@@ -412,7 +416,7 @@ Optional. The principal type of the assigned principal ID.
### Parameter: `roleAssignments.roleDefinitionIdOrName`
-Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.
+Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
- Required: Yes
- Type: string
diff --git a/modules/compute/availability-set/main.bicep b/modules/compute/availability-set/main.bicep
index d48a10bd65..e7365a0176 100644
--- a/modules/compute/availability-set/main.bicep
+++ b/modules/compute/availability-set/main.bicep
@@ -23,7 +23,7 @@ param location string = resourceGroup().location
@description('Optional. The lock settings of the service.')
param lock lockType
-@description('Optional. Array of role assignment objects that contain the \'roleDefinitionIdOrName\' and \'principalId\' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
+@description('Optional. Array of role assignments to create.')
param roleAssignments roleAssignmentType
@description('Optional. Tags of the availability set resource.')
@@ -81,7 +81,7 @@ resource availabilitySet_lock 'Microsoft.Authorization/locks@2020-05-01' = if (!
resource availabilitySet_roleAssignments 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for (roleAssignment, index) in (roleAssignments ?? []): {
name: guid(availabilitySet.id, roleAssignment.principalId, roleAssignment.roleDefinitionIdOrName)
properties: {
- roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : roleAssignment.roleDefinitionIdOrName
+ roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : contains(roleAssignment.roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/') ? roleAssignment.roleDefinitionIdOrName : subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleAssignment.roleDefinitionIdOrName)
principalId: roleAssignment.principalId
description: roleAssignment.?description
principalType: roleAssignment.?principalType
@@ -117,7 +117,7 @@ type lockType = {
}?
type roleAssignmentType = {
- @description('Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.')
+ @description('Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
roleDefinitionIdOrName: string
@description('Required. The principal ID of the principal (user/group/identity) to assign the role to.')
diff --git a/modules/compute/availability-set/main.json b/modules/compute/availability-set/main.json
index b95d3d6e5b..1785fba305 100644
--- a/modules/compute/availability-set/main.json
+++ b/modules/compute/availability-set/main.json
@@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
- "templateHash": "10273034762819706688"
+ "templateHash": "5227518019590396567"
},
"name": "Availability Sets",
"description": "This module deploys an Availability Set.",
@@ -46,7 +46,7 @@
"roleDefinitionIdOrName": {
"type": "string",
"metadata": {
- "description": "Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead."
+ "description": "Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
}
},
"principalId": {
@@ -156,7 +156,7 @@
"roleAssignments": {
"$ref": "#/definitions/roleAssignmentType",
"metadata": {
- "description": "Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
+ "description": "Optional. Array of role assignments to create."
}
},
"tags": {
@@ -237,7 +237,7 @@
"scope": "[format('Microsoft.Compute/availabilitySets/{0}', parameters('name'))]",
"name": "[guid(resourceId('Microsoft.Compute/availabilitySets', parameters('name')), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId, coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
"properties": {
- "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
+ "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], if(contains(coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)))]",
"principalId": "[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId]",
"description": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'description')]",
"principalType": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'principalType')]",
diff --git a/modules/compute/availability-set/tests/e2e/max/main.test.bicep b/modules/compute/availability-set/tests/e2e/max/main.test.bicep
index 1241842e7b..af84f42458 100644
--- a/modules/compute/availability-set/tests/e2e/max/main.test.bicep
+++ b/modules/compute/availability-set/tests/e2e/max/main.test.bicep
@@ -61,7 +61,17 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
proximityPlacementGroupResourceId: nestedDependencies.outputs.proximityPlacementGroupResourceId
roleAssignments: [
{
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')
principalId: nestedDependencies.outputs.managedIdentityPrincipalId
principalType: 'ServicePrincipal'
}
diff --git a/modules/compute/availability-set/tests/e2e/waf-aligned/main.test.bicep b/modules/compute/availability-set/tests/e2e/waf-aligned/main.test.bicep
index 7a305c8119..6aff4b922e 100644
--- a/modules/compute/availability-set/tests/e2e/waf-aligned/main.test.bicep
+++ b/modules/compute/availability-set/tests/e2e/waf-aligned/main.test.bicep
@@ -59,13 +59,6 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
name: 'myCustomLockName'
}
proximityPlacementGroupResourceId: nestedDependencies.outputs.proximityPlacementGroupResourceId
- roleAssignments: [
- {
- roleDefinitionIdOrName: 'Reader'
- principalId: nestedDependencies.outputs.managedIdentityPrincipalId
- principalType: 'ServicePrincipal'
- }
- ]
tags: {
'hidden-title': 'This is visible in the resource name'
Environment: 'Non-Prod'
diff --git a/modules/compute/disk-encryption-set/README.md b/modules/compute/disk-encryption-set/README.md
index 024684795c..48783288cd 100644
--- a/modules/compute/disk-encryption-set/README.md
+++ b/modules/compute/disk-encryption-set/README.md
@@ -58,7 +58,17 @@ module diskEncryptionSet 'br:bicep/modules/compute.disk-encryption-set:1.0.0' =
{
principalId: ''
principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: ''
}
]
tags: {
@@ -109,7 +119,17 @@ module diskEncryptionSet 'br:bicep/modules/compute.disk-encryption-set:1.0.0' =
{
"principalId": "",
"principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
+ "roleDefinitionIdOrName": "Owner"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": "b24988ac-6180-42a0-ab88-20f7382dd24c"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": ""
}
]
},
@@ -159,7 +179,17 @@ module diskEncryptionSet 'br:bicep/modules/compute.disk-encryption-set:1.0.0' =
{
principalId: ''
principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: ''
}
]
tags: {
@@ -215,7 +245,17 @@ module diskEncryptionSet 'br:bicep/modules/compute.disk-encryption-set:1.0.0' =
{
"principalId": "",
"principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
+ "roleDefinitionIdOrName": "Owner"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": "b24988ac-6180-42a0-ab88-20f7382dd24c"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": ""
}
]
},
@@ -261,13 +301,6 @@ module diskEncryptionSet 'br:bicep/modules/compute.disk-encryption-set:1.0.0' =
''
]
}
- roleAssignments: [
- {
- principalId: ''
- principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
- }
- ]
tags: {
Environment: 'Non-Prod'
'hidden-title': 'This is visible in the resource name'
@@ -316,15 +349,6 @@ module diskEncryptionSet 'br:bicep/modules/compute.disk-encryption-set:1.0.0' =
]
}
},
- "roleAssignments": {
- "value": [
- {
- "principalId": "",
- "principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
- }
- ]
- },
"tags": {
"value": {
"Environment": "Non-Prod",
@@ -361,7 +385,7 @@ module diskEncryptionSet 'br:bicep/modules/compute.disk-encryption-set:1.0.0' =
| [`location`](#parameter-location) | string | Resource location. |
| [`lock`](#parameter-lock) | object | The lock settings of the service. |
| [`managedIdentities`](#parameter-managedidentities) | object | The managed identity definition for this resource. At least one identity type is required. |
-| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
+| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignments to create. |
| [`rotationToLatestKeyVersionEnabled`](#parameter-rotationtolatestkeyversionenabled) | bool | Set this flag to true to enable auto-updating of this disk encryption set to the latest key version. |
| [`tags`](#parameter-tags) | object | Tags of the disk encryption resource. |
@@ -486,7 +510,7 @@ The name of the disk encryption set that is being created.
### Parameter: `roleAssignments`
-Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
+Array of role assignments to create.
- Required: No
- Type: array
@@ -499,7 +523,7 @@ Array of role assignment objects that contain the 'roleDefinitionIdOrName' and '
| [`description`](#parameter-roleassignmentsdescription) | No | string | Optional. The description of the role assignment. |
| [`principalId`](#parameter-roleassignmentsprincipalid) | Yes | string | Required. The principal ID of the principal (user/group/identity) to assign the role to. |
| [`principalType`](#parameter-roleassignmentsprincipaltype) | No | string | Optional. The principal type of the assigned principal ID. |
-| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead. |
+| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
### Parameter: `roleAssignments.condition`
@@ -547,7 +571,7 @@ Optional. The principal type of the assigned principal ID.
### Parameter: `roleAssignments.roleDefinitionIdOrName`
-Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.
+Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
- Required: Yes
- Type: string
diff --git a/modules/compute/disk-encryption-set/main.bicep b/modules/compute/disk-encryption-set/main.bicep
index 0a96eb063a..c31fc9e4b7 100644
--- a/modules/compute/disk-encryption-set/main.bicep
+++ b/modules/compute/disk-encryption-set/main.bicep
@@ -38,7 +38,7 @@ param managedIdentities managedIdentitiesType = {
systemAssigned: true
}
-@description('Optional. Array of role assignment objects that contain the \'roleDefinitionIdOrName\' and \'principalId\' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
+@description('Optional. Array of role assignments to create.')
param roleAssignments roleAssignmentType
@description('Optional. Tags of the disk encryption resource.')
@@ -125,7 +125,7 @@ resource diskEncryptionSet 'Microsoft.Compute/diskEncryptionSets@2022-07-02' = {
resource diskEncryptionSet_roleAssignments 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for (roleAssignment, index) in (roleAssignments ?? []): {
name: guid(diskEncryptionSet.id, roleAssignment.principalId, roleAssignment.roleDefinitionIdOrName)
properties: {
- roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : roleAssignment.roleDefinitionIdOrName
+ roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : contains(roleAssignment.roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/') ? roleAssignment.roleDefinitionIdOrName : subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleAssignment.roleDefinitionIdOrName)
principalId: roleAssignment.principalId
description: roleAssignment.?description
principalType: roleAssignment.?principalType
@@ -187,7 +187,7 @@ type lockType = {
}?
type roleAssignmentType = {
- @description('Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.')
+ @description('Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
roleDefinitionIdOrName: string
@description('Required. The principal ID of the principal (user/group/identity) to assign the role to.')
diff --git a/modules/compute/disk-encryption-set/main.json b/modules/compute/disk-encryption-set/main.json
index d55eee6014..dbd6c27c6b 100644
--- a/modules/compute/disk-encryption-set/main.json
+++ b/modules/compute/disk-encryption-set/main.json
@@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
- "templateHash": "2310785535465824906"
+ "templateHash": "3002808940290583221"
},
"name": "Disk Encryption Sets",
"description": "This module deploys a Disk Encryption Set.",
@@ -68,7 +68,7 @@
"roleDefinitionIdOrName": {
"type": "string",
"metadata": {
- "description": "Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead."
+ "description": "Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
}
},
"principalId": {
@@ -203,7 +203,7 @@
"roleAssignments": {
"$ref": "#/definitions/roleAssignmentType",
"metadata": {
- "description": "Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
+ "description": "Optional. Array of role assignments to create."
}
},
"tags": {
@@ -304,7 +304,7 @@
"scope": "[format('Microsoft.Compute/diskEncryptionSets/{0}', parameters('name'))]",
"name": "[guid(resourceId('Microsoft.Compute/diskEncryptionSets', parameters('name')), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId, coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
"properties": {
- "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
+ "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], if(contains(coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)))]",
"principalId": "[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId]",
"description": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'description')]",
"principalType": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'principalType')]",
diff --git a/modules/compute/disk-encryption-set/tests/e2e/accessPolicies/main.test.bicep b/modules/compute/disk-encryption-set/tests/e2e/accessPolicies/main.test.bicep
index f494661b94..c7ca375354 100644
--- a/modules/compute/disk-encryption-set/tests/e2e/accessPolicies/main.test.bicep
+++ b/modules/compute/disk-encryption-set/tests/e2e/accessPolicies/main.test.bicep
@@ -59,7 +59,17 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
keyVaultResourceId: nestedDependencies.outputs.keyVaultResourceId
roleAssignments: [
{
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')
principalId: nestedDependencies.outputs.managedIdentityPrincipalId
principalType: 'ServicePrincipal'
}
diff --git a/modules/compute/disk-encryption-set/tests/e2e/max/main.test.bicep b/modules/compute/disk-encryption-set/tests/e2e/max/main.test.bicep
index b71ed7a6ec..23cb40bc46 100644
--- a/modules/compute/disk-encryption-set/tests/e2e/max/main.test.bicep
+++ b/modules/compute/disk-encryption-set/tests/e2e/max/main.test.bicep
@@ -66,7 +66,17 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
keyVaultResourceId: nestedDependencies.outputs.keyVaultResourceId
roleAssignments: [
{
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')
principalId: nestedDependencies.outputs.managedIdentityPrincipalId
principalType: 'ServicePrincipal'
}
diff --git a/modules/compute/disk-encryption-set/tests/e2e/waf-aligned/main.test.bicep b/modules/compute/disk-encryption-set/tests/e2e/waf-aligned/main.test.bicep
index c49b0266d2..f27ccfe1eb 100644
--- a/modules/compute/disk-encryption-set/tests/e2e/waf-aligned/main.test.bicep
+++ b/modules/compute/disk-encryption-set/tests/e2e/waf-aligned/main.test.bicep
@@ -64,13 +64,6 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
}
keyName: nestedDependencies.outputs.keyName
keyVaultResourceId: nestedDependencies.outputs.keyVaultResourceId
- roleAssignments: [
- {
- roleDefinitionIdOrName: 'Reader'
- principalId: nestedDependencies.outputs.managedIdentityPrincipalId
- principalType: 'ServicePrincipal'
- }
- ]
managedIdentities: {
userAssignedResourceIds: [
nestedDependencies.outputs.managedIdentityResourceId
diff --git a/modules/compute/disk/README.md b/modules/compute/disk/README.md
index a2b245fd26..feef599a20 100644
--- a/modules/compute/disk/README.md
+++ b/modules/compute/disk/README.md
@@ -109,7 +109,17 @@ module disk 'br:bicep/modules/compute.disk:1.0.0' = {
{
principalId: ''
principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: ''
}
]
tags: {
@@ -155,7 +165,17 @@ module disk 'br:bicep/modules/compute.disk:1.0.0' = {
{
"principalId": "",
"principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
+ "roleDefinitionIdOrName": "Owner"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": "b24988ac-6180-42a0-ab88-20f7382dd24c"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": ""
}
]
},
@@ -193,7 +213,17 @@ module disk 'br:bicep/modules/compute.disk:1.0.0' = {
{
principalId: ''
principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: ''
}
]
sourceUri: ''
@@ -238,7 +268,17 @@ module disk 'br:bicep/modules/compute.disk:1.0.0' = {
{
"principalId": "",
"principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
+ "roleDefinitionIdOrName": "Owner"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": "b24988ac-6180-42a0-ab88-20f7382dd24c"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": ""
}
]
},
@@ -294,7 +334,17 @@ module disk 'br:bicep/modules/compute.disk:1.0.0' = {
{
principalId: ''
principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: ''
}
]
tags: {
@@ -358,7 +408,17 @@ module disk 'br:bicep/modules/compute.disk:1.0.0' = {
{
"principalId": "",
"principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
+ "roleDefinitionIdOrName": "Owner"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": "b24988ac-6180-42a0-ab88-20f7382dd24c"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": ""
}
]
},
@@ -404,13 +464,6 @@ module disk 'br:bicep/modules/compute.disk:1.0.0' = {
logicalSectorSize: 512
osType: 'Windows'
publicNetworkAccess: 'Enabled'
- roleAssignments: [
- {
- principalId: ''
- principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
- }
- ]
tags: {
Environment: 'Non-Prod'
'hidden-title': 'This is visible in the resource name'
@@ -467,15 +520,6 @@ module disk 'br:bicep/modules/compute.disk:1.0.0' = {
"publicNetworkAccess": {
"value": "Enabled"
},
- "roleAssignments": {
- "value": [
- {
- "principalId": "",
- "principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
- }
- ]
- },
"tags": {
"value": {
"Environment": "Non-Prod",
@@ -529,7 +573,7 @@ module disk 'br:bicep/modules/compute.disk:1.0.0' = {
| [`optimizedForFrequentAttach`](#parameter-optimizedforfrequentattach) | bool | Setting this property to true improves reliability and performance of data disks that are frequently (more than 5 times a day) by detached from one virtual machine and attached to another. This property should not be set for disks that are not detached and attached frequently as it causes the disks to not align with the fault domain of the virtual machine. |
| [`osType`](#parameter-ostype) | string | Sources of a disk creation. |
| [`publicNetworkAccess`](#parameter-publicnetworkaccess) | string | Policy for controlling export on the disk. |
-| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
+| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignments to create. |
| [`securityDataUri`](#parameter-securitydatauri) | string | If create option is ImportSecure, this is the URI of a blob to be imported into VM guest state. |
| [`sourceResourceId`](#parameter-sourceresourceid) | string | If create option is Copy, this is the ARM ID of the source snapshot or disk. |
| [`sourceUri`](#parameter-sourceuri) | string | If create option is Import, this is the URI of a blob to be imported into a managed disk. |
@@ -750,7 +794,7 @@ Policy for controlling export on the disk.
### Parameter: `roleAssignments`
-Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
+Array of role assignments to create.
- Required: No
- Type: array
@@ -763,7 +807,7 @@ Array of role assignment objects that contain the 'roleDefinitionIdOrName' and '
| [`description`](#parameter-roleassignmentsdescription) | No | string | Optional. The description of the role assignment. |
| [`principalId`](#parameter-roleassignmentsprincipalid) | Yes | string | Required. The principal ID of the principal (user/group/identity) to assign the role to. |
| [`principalType`](#parameter-roleassignmentsprincipaltype) | No | string | Optional. The principal type of the assigned principal ID. |
-| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead. |
+| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
### Parameter: `roleAssignments.condition`
@@ -811,7 +855,7 @@ Optional. The principal type of the assigned principal ID.
### Parameter: `roleAssignments.roleDefinitionIdOrName`
-Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.
+Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
- Required: Yes
- Type: string
diff --git a/modules/compute/disk/main.bicep b/modules/compute/disk/main.bicep
index b81bda894c..7989977bb4 100644
--- a/modules/compute/disk/main.bicep
+++ b/modules/compute/disk/main.bicep
@@ -121,7 +121,7 @@ param acceleratedNetwork bool = false
@description('Optional. The lock settings of the service.')
param lock lockType
-@description('Optional. Array of role assignment objects that contain the \'roleDefinitionIdOrName\' and \'principalId\' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
+@description('Optional. Array of role assignments to create.')
param roleAssignments roleAssignmentType
@description('Optional. Tags of the availability set resource.')
@@ -205,7 +205,7 @@ resource disk_lock 'Microsoft.Authorization/locks@2020-05-01' = if (!empty(lock
resource disk_roleAssignments 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for (roleAssignment, index) in (roleAssignments ?? []): {
name: guid(disk.id, roleAssignment.principalId, roleAssignment.roleDefinitionIdOrName)
properties: {
- roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : roleAssignment.roleDefinitionIdOrName
+ roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : contains(roleAssignment.roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/') ? roleAssignment.roleDefinitionIdOrName : subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleAssignment.roleDefinitionIdOrName)
principalId: roleAssignment.principalId
description: roleAssignment.?description
principalType: roleAssignment.?principalType
@@ -241,7 +241,7 @@ type lockType = {
}?
type roleAssignmentType = {
- @description('Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.')
+ @description('Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
roleDefinitionIdOrName: string
@description('Required. The principal ID of the principal (user/group/identity) to assign the role to.')
diff --git a/modules/compute/disk/main.json b/modules/compute/disk/main.json
index efff55288f..37e7361de7 100644
--- a/modules/compute/disk/main.json
+++ b/modules/compute/disk/main.json
@@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
- "templateHash": "13415296044159532527"
+ "templateHash": "8419179965275134660"
},
"name": "Compute Disks",
"description": "This module deploys a Compute Disk",
@@ -46,7 +46,7 @@
"roleDefinitionIdOrName": {
"type": "string",
"metadata": {
- "description": "Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead."
+ "description": "Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
}
},
"principalId": {
@@ -325,7 +325,7 @@
"roleAssignments": {
"$ref": "#/definitions/roleAssignmentType",
"metadata": {
- "description": "Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
+ "description": "Optional. Array of role assignments to create."
}
},
"tags": {
@@ -430,7 +430,7 @@
"scope": "[format('Microsoft.Compute/disks/{0}', parameters('name'))]",
"name": "[guid(resourceId('Microsoft.Compute/disks', parameters('name')), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId, coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
"properties": {
- "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
+ "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], if(contains(coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)))]",
"principalId": "[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId]",
"description": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'description')]",
"principalType": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'principalType')]",
diff --git a/modules/compute/disk/tests/e2e/image/main.test.bicep b/modules/compute/disk/tests/e2e/image/main.test.bicep
index 7b49045a5d..67fd259073 100644
--- a/modules/compute/disk/tests/e2e/image/main.test.bicep
+++ b/modules/compute/disk/tests/e2e/image/main.test.bicep
@@ -54,7 +54,17 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
imageReferenceId: '${subscription().id}/Providers/Microsoft.Compute/Locations/westeurope/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2022-datacenter-azure-edition/Versions/20348.1006.220908'
roleAssignments: [
{
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')
principalId: nestedDependencies.outputs.managedIdentityPrincipalId
principalType: 'ServicePrincipal'
}
diff --git a/modules/compute/disk/tests/e2e/import/main.test.bicep b/modules/compute/disk/tests/e2e/import/main.test.bicep
index e343bbfbdc..0622d78455 100644
--- a/modules/compute/disk/tests/e2e/import/main.test.bicep
+++ b/modules/compute/disk/tests/e2e/import/main.test.bicep
@@ -57,7 +57,17 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
createOption: 'Import'
roleAssignments: [
{
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')
principalId: nestedDependencies.outputs.managedIdentityPrincipalId
principalType: 'ServicePrincipal'
}
diff --git a/modules/compute/disk/tests/e2e/max/main.test.bicep b/modules/compute/disk/tests/e2e/max/main.test.bicep
index cd544f46b9..25ab818edd 100644
--- a/modules/compute/disk/tests/e2e/max/main.test.bicep
+++ b/modules/compute/disk/tests/e2e/max/main.test.bicep
@@ -65,7 +65,17 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
publicNetworkAccess: 'Enabled'
roleAssignments: [
{
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')
principalId: nestedDependencies.outputs.managedIdentityPrincipalId
principalType: 'ServicePrincipal'
}
diff --git a/modules/compute/disk/tests/e2e/waf-aligned/main.test.bicep b/modules/compute/disk/tests/e2e/waf-aligned/main.test.bicep
index 0b70c6e0b5..e22035fb5e 100644
--- a/modules/compute/disk/tests/e2e/waf-aligned/main.test.bicep
+++ b/modules/compute/disk/tests/e2e/waf-aligned/main.test.bicep
@@ -63,13 +63,6 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
logicalSectorSize: 512
osType: 'Windows'
publicNetworkAccess: 'Enabled'
- roleAssignments: [
- {
- roleDefinitionIdOrName: 'Reader'
- principalId: nestedDependencies.outputs.managedIdentityPrincipalId
- principalType: 'ServicePrincipal'
- }
- ]
tags: {
'hidden-title': 'This is visible in the resource name'
Environment: 'Non-Prod'
diff --git a/modules/compute/gallery/README.md b/modules/compute/gallery/README.md
index 5d352f0fb3..478eaa6765 100644
--- a/modules/compute/gallery/README.md
+++ b/modules/compute/gallery/README.md
@@ -222,7 +222,17 @@ module gallery 'br:bicep/modules/compute.gallery:1.0.0' = {
{
principalId: ''
principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: ''
}
]
tags: {
@@ -386,7 +396,17 @@ module gallery 'br:bicep/modules/compute.gallery:1.0.0' = {
{
"principalId": "",
"principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
+ "roleDefinitionIdOrName": "Owner"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": "b24988ac-6180-42a0-ab88-20f7382dd24c"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": ""
}
]
},
@@ -542,13 +562,6 @@ module gallery 'br:bicep/modules/compute.gallery:1.0.0' = {
kind: 'CanNotDelete'
name: 'myCustomLockName'
}
- roleAssignments: [
- {
- principalId: ''
- principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
- }
- ]
tags: {
Environment: 'Non-Prod'
'hidden-title': 'This is visible in the resource name'
@@ -705,15 +718,6 @@ module gallery 'br:bicep/modules/compute.gallery:1.0.0' = {
"name": "myCustomLockName"
}
},
- "roleAssignments": {
- "value": [
- {
- "principalId": "",
- "principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
- }
- ]
- },
"tags": {
"value": {
"Environment": "Non-Prod",
diff --git a/modules/compute/gallery/application/main.bicep b/modules/compute/gallery/application/main.bicep
index f1cf6372c2..dcb745225b 100644
--- a/modules/compute/gallery/application/main.bicep
+++ b/modules/compute/gallery/application/main.bicep
@@ -90,7 +90,7 @@ resource application 'Microsoft.Compute/galleries/applications@2022-03-03' = {
resource application_roleAssignments 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for (roleAssignment, index) in (roleAssignments ?? []): {
name: guid(application.id, roleAssignment.principalId, roleAssignment.roleDefinitionIdOrName)
properties: {
- roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : roleAssignment.roleDefinitionIdOrName
+ roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : contains(roleAssignment.roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/') ? roleAssignment.roleDefinitionIdOrName : subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleAssignment.roleDefinitionIdOrName)
principalId: roleAssignment.principalId
description: roleAssignment.?description
principalType: roleAssignment.?principalType
diff --git a/modules/compute/gallery/application/main.json b/modules/compute/gallery/application/main.json
index ffc09df846..173a43d0c8 100644
--- a/modules/compute/gallery/application/main.json
+++ b/modules/compute/gallery/application/main.json
@@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
- "version": "0.22.6.54827",
- "templateHash": "4468420728204112478"
+ "version": "0.23.1.45101",
+ "templateHash": "13733131047823769084"
},
"name": "Compute Galleries Applications",
"description": "This module deploys an Azure Compute Gallery Application.",
@@ -235,7 +235,7 @@
"scope": "[format('Microsoft.Compute/galleries/{0}/applications/{1}', parameters('galleryName'), parameters('name'))]",
"name": "[guid(resourceId('Microsoft.Compute/galleries/applications', parameters('galleryName'), parameters('name')), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId, coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
"properties": {
- "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
+ "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], if(contains(coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)))]",
"principalId": "[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId]",
"description": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'description')]",
"principalType": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'principalType')]",
diff --git a/modules/compute/gallery/image/main.bicep b/modules/compute/gallery/image/main.bicep
index 3f5a724b3c..a922e5e74b 100644
--- a/modules/compute/gallery/image/main.bicep
+++ b/modules/compute/gallery/image/main.bicep
@@ -213,7 +213,7 @@ resource image 'Microsoft.Compute/galleries/images@2022-03-03' = {
resource image_roleAssignments 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for (roleAssignment, index) in (roleAssignments ?? []): {
name: guid(image.id, roleAssignment.principalId, roleAssignment.roleDefinitionIdOrName)
properties: {
- roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : roleAssignment.roleDefinitionIdOrName
+ roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : contains(roleAssignment.roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/') ? roleAssignment.roleDefinitionIdOrName : subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleAssignment.roleDefinitionIdOrName)
principalId: roleAssignment.principalId
description: roleAssignment.?description
principalType: roleAssignment.?principalType
diff --git a/modules/compute/gallery/image/main.json b/modules/compute/gallery/image/main.json
index 9c37688f70..966b22684c 100644
--- a/modules/compute/gallery/image/main.json
+++ b/modules/compute/gallery/image/main.json
@@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
- "version": "0.22.6.54827",
- "templateHash": "12640831453229356933"
+ "version": "0.23.1.45101",
+ "templateHash": "17846161223611480196"
},
"name": "Compute Galleries Image Definitions",
"description": "This module deploys an Azure Compute Gallery Image Definition.",
@@ -396,7 +396,7 @@
"scope": "[format('Microsoft.Compute/galleries/{0}/images/{1}', parameters('galleryName'), parameters('name'))]",
"name": "[guid(resourceId('Microsoft.Compute/galleries/images', parameters('galleryName'), parameters('name')), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId, coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
"properties": {
- "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
+ "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], if(contains(coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)))]",
"principalId": "[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId]",
"description": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'description')]",
"principalType": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'principalType')]",
diff --git a/modules/compute/gallery/main.bicep b/modules/compute/gallery/main.bicep
index 5d9a951fa4..54aaf1e3f9 100644
--- a/modules/compute/gallery/main.bicep
+++ b/modules/compute/gallery/main.bicep
@@ -75,7 +75,7 @@ resource gallery_lock 'Microsoft.Authorization/locks@2020-05-01' = if (!empty(lo
resource gallery_roleAssignments 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for (roleAssignment, index) in (roleAssignments ?? []): {
name: guid(gallery.id, roleAssignment.principalId, roleAssignment.roleDefinitionIdOrName)
properties: {
- roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : roleAssignment.roleDefinitionIdOrName
+ roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : contains(roleAssignment.roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/') ? roleAssignment.roleDefinitionIdOrName : subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleAssignment.roleDefinitionIdOrName)
principalId: roleAssignment.principalId
description: roleAssignment.?description
principalType: roleAssignment.?principalType
diff --git a/modules/compute/gallery/main.json b/modules/compute/gallery/main.json
index 988b6b53a7..44e5d0a6f9 100644
--- a/modules/compute/gallery/main.json
+++ b/modules/compute/gallery/main.json
@@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
- "templateHash": "8907363611903070816"
+ "templateHash": "15313131097423380423"
},
"name": "Azure Compute Galleries",
"description": "This module deploys an Azure Compute Gallery (formerly known as Shared Image Gallery).",
@@ -229,7 +229,7 @@
"scope": "[format('Microsoft.Compute/galleries/{0}', parameters('name'))]",
"name": "[guid(resourceId('Microsoft.Compute/galleries', parameters('name')), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId, coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
"properties": {
- "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
+ "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], if(contains(coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)))]",
"principalId": "[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId]",
"description": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'description')]",
"principalType": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'principalType')]",
@@ -284,7 +284,7 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
- "templateHash": "8232745966352037801"
+ "templateHash": "13733131047823769084"
},
"name": "Compute Galleries Applications",
"description": "This module deploys an Azure Compute Gallery Application.",
@@ -513,7 +513,7 @@
"scope": "[format('Microsoft.Compute/galleries/{0}/applications/{1}', parameters('galleryName'), parameters('name'))]",
"name": "[guid(resourceId('Microsoft.Compute/galleries/applications', parameters('galleryName'), parameters('name')), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId, coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
"properties": {
- "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
+ "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], if(contains(coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)))]",
"principalId": "[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId]",
"description": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'description')]",
"principalType": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'principalType')]",
@@ -618,7 +618,7 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
- "templateHash": "3383509605637851908"
+ "templateHash": "17846161223611480196"
},
"name": "Compute Galleries Image Definitions",
"description": "This module deploys an Azure Compute Gallery Image Definition.",
@@ -1008,7 +1008,7 @@
"scope": "[format('Microsoft.Compute/galleries/{0}/images/{1}', parameters('galleryName'), parameters('name'))]",
"name": "[guid(resourceId('Microsoft.Compute/galleries/images', parameters('galleryName'), parameters('name')), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId, coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
"properties": {
- "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
+ "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], if(contains(coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)))]",
"principalId": "[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId]",
"description": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'description')]",
"principalType": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'principalType')]",
diff --git a/modules/compute/gallery/tests/e2e/max/main.test.bicep b/modules/compute/gallery/tests/e2e/max/main.test.bicep
index efc7e9a946..2562a048e5 100644
--- a/modules/compute/gallery/tests/e2e/max/main.test.bicep
+++ b/modules/compute/gallery/tests/e2e/max/main.test.bicep
@@ -176,7 +176,17 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
]
roleAssignments: [
{
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')
principalId: nestedDependencies.outputs.managedIdentityPrincipalId
principalType: 'ServicePrincipal'
}
diff --git a/modules/compute/gallery/tests/e2e/waf-aligned/main.test.bicep b/modules/compute/gallery/tests/e2e/waf-aligned/main.test.bicep
index c519821e4f..7d759c2f2a 100644
--- a/modules/compute/gallery/tests/e2e/waf-aligned/main.test.bicep
+++ b/modules/compute/gallery/tests/e2e/waf-aligned/main.test.bicep
@@ -174,13 +174,6 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
sku: '20_04-lts-gen2'
}
]
- roleAssignments: [
- {
- roleDefinitionIdOrName: 'Reader'
- principalId: nestedDependencies.outputs.managedIdentityPrincipalId
- principalType: 'ServicePrincipal'
- }
- ]
tags: {
'hidden-title': 'This is visible in the resource name'
Environment: 'Non-Prod'
diff --git a/modules/compute/image/README.md b/modules/compute/image/README.md
index f642c6f3c1..8b7d4eb4db 100644
--- a/modules/compute/image/README.md
+++ b/modules/compute/image/README.md
@@ -57,7 +57,17 @@ module image 'br:bicep/modules/compute.image:1.0.0' = {
{
principalId: ''
principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: ''
}
]
tags: {
@@ -119,7 +129,17 @@ module image 'br:bicep/modules/compute.image:1.0.0' = {
{
"principalId": "",
"principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
+ "roleDefinitionIdOrName": "Owner"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": "b24988ac-6180-42a0-ab88-20f7382dd24c"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": ""
}
]
},
@@ -165,13 +185,6 @@ module image 'br:bicep/modules/compute.image:1.0.0' = {
enableDefaultTelemetry: ''
hyperVGeneration: 'V1'
osState: 'Generalized'
- roleAssignments: [
- {
- principalId: ''
- principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
- }
- ]
tags: {
'hidden-title': 'This is visible in the resource name'
tagA: 'You\'re it'
@@ -226,15 +239,6 @@ module image 'br:bicep/modules/compute.image:1.0.0' = {
"osState": {
"value": "Generalized"
},
- "roleAssignments": {
- "value": [
- {
- "principalId": "",
- "principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
- }
- ]
- },
"tags": {
"value": {
"hidden-title": "This is visible in the resource name",
@@ -278,7 +282,7 @@ module image 'br:bicep/modules/compute.image:1.0.0' = {
| [`osAccountType`](#parameter-osaccounttype) | string | Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. - Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS. |
| [`osDiskCaching`](#parameter-osdiskcaching) | string | Specifies the caching requirements. Default: None for Standard storage. ReadOnly for Premium storage. - None, ReadOnly, ReadWrite. |
| [`osState`](#parameter-osstate) | string | The OS State. For managed images, use Generalized. |
-| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
+| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignments to create. |
| [`snapshotResourceId`](#parameter-snapshotresourceid) | string | The snapshot resource ID. |
| [`sourceVirtualMachineResourceId`](#parameter-sourcevirtualmachineresourceid) | string | The source virtual machine from which Image is created. |
| [`tags`](#parameter-tags) | object | Tags of the resource. |
@@ -386,7 +390,7 @@ This property allows you to specify the type of the OS that is included in the d
### Parameter: `roleAssignments`
-Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
+Array of role assignments to create.
- Required: No
- Type: array
@@ -399,7 +403,7 @@ Array of role assignment objects that contain the 'roleDefinitionIdOrName' and '
| [`description`](#parameter-roleassignmentsdescription) | No | string | Optional. The description of the role assignment. |
| [`principalId`](#parameter-roleassignmentsprincipalid) | Yes | string | Required. The principal ID of the principal (user/group/identity) to assign the role to. |
| [`principalType`](#parameter-roleassignmentsprincipaltype) | No | string | Optional. The principal type of the assigned principal ID. |
-| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead. |
+| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
### Parameter: `roleAssignments.condition`
@@ -447,7 +451,7 @@ Optional. The principal type of the assigned principal ID.
### Parameter: `roleAssignments.roleDefinitionIdOrName`
-Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.
+Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
- Required: Yes
- Type: string
diff --git a/modules/compute/image/main.bicep b/modules/compute/image/main.bicep
index f83ef220ab..20e3e6ea11 100644
--- a/modules/compute/image/main.bicep
+++ b/modules/compute/image/main.bicep
@@ -26,7 +26,7 @@ param zoneResilient bool = false
@description('Optional. Gets the HyperVGenerationType of the VirtualMachine created from the image. - V1 or V2.')
param hyperVGeneration string = 'V1'
-@description('Optional. Array of role assignment objects that contain the \'roleDefinitionIdOrName\' and \'principalId\' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
+@description('Optional. Array of role assignments to create.')
param roleAssignments roleAssignmentType
@description('Optional. Tags of the resource.')
@@ -120,7 +120,7 @@ resource image 'Microsoft.Compute/images@2022-11-01' = {
resource image_roleAssignments 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for (roleAssignment, index) in (roleAssignments ?? []): {
name: guid(image.id, roleAssignment.principalId, roleAssignment.roleDefinitionIdOrName)
properties: {
- roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : roleAssignment.roleDefinitionIdOrName
+ roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : contains(roleAssignment.roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/') ? roleAssignment.roleDefinitionIdOrName : subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleAssignment.roleDefinitionIdOrName)
principalId: roleAssignment.principalId
description: roleAssignment.?description
principalType: roleAssignment.?principalType
@@ -147,7 +147,7 @@ output location string = image.location
// =============== //
type roleAssignmentType = {
- @description('Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.')
+ @description('Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
roleDefinitionIdOrName: string
@description('Required. The principal ID of the principal (user/group/identity) to assign the role to.')
diff --git a/modules/compute/image/main.json b/modules/compute/image/main.json
index d559e8bc9b..b3099a9dec 100644
--- a/modules/compute/image/main.json
+++ b/modules/compute/image/main.json
@@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
- "templateHash": "18345867974770384550"
+ "templateHash": "6473488393825855372"
},
"name": "Images",
"description": "This module deploys a Compute Image.",
@@ -21,7 +21,7 @@
"roleDefinitionIdOrName": {
"type": "string",
"metadata": {
- "description": "Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead."
+ "description": "Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
}
},
"principalId": {
@@ -135,7 +135,7 @@
"roleAssignments": {
"$ref": "#/definitions/roleAssignmentType",
"metadata": {
- "description": "Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
+ "description": "Optional. Array of role assignments to create."
}
},
"tags": {
@@ -274,7 +274,7 @@
"scope": "[format('Microsoft.Compute/images/{0}', parameters('name'))]",
"name": "[guid(resourceId('Microsoft.Compute/images', parameters('name')), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId, coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
"properties": {
- "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
+ "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], if(contains(coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)))]",
"principalId": "[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId]",
"description": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'description')]",
"principalType": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'principalType')]",
diff --git a/modules/compute/image/tests/e2e/max/main.test.bicep b/modules/compute/image/tests/e2e/max/main.test.bicep
index e4da6461c2..4ef529aeea 100644
--- a/modules/compute/image/tests/e2e/max/main.test.bicep
+++ b/modules/compute/image/tests/e2e/max/main.test.bicep
@@ -69,7 +69,17 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
hyperVGeneration: 'V1'
roleAssignments: [
{
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')
principalId: nestedDependencies.outputs.managedIdentityPrincipalId
principalType: 'ServicePrincipal'
}
diff --git a/modules/compute/image/tests/e2e/waf-aligned/main.test.bicep b/modules/compute/image/tests/e2e/waf-aligned/main.test.bicep
index 8403077e92..ee4dfe3db0 100644
--- a/modules/compute/image/tests/e2e/waf-aligned/main.test.bicep
+++ b/modules/compute/image/tests/e2e/waf-aligned/main.test.bicep
@@ -67,13 +67,6 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
osDiskCaching: 'ReadWrite'
osType: 'Windows'
hyperVGeneration: 'V1'
- roleAssignments: [
- {
- roleDefinitionIdOrName: 'Reader'
- principalId: nestedDependencies.outputs.managedIdentityPrincipalId
- principalType: 'ServicePrincipal'
- }
- ]
zoneResilient: true
diskEncryptionSetResourceId: nestedDependencies.outputs.diskEncryptionSetResourceId
osState: 'Generalized'
diff --git a/modules/compute/proximity-placement-group/README.md b/modules/compute/proximity-placement-group/README.md
index a5861c05f9..b78e4a52f2 100644
--- a/modules/compute/proximity-placement-group/README.md
+++ b/modules/compute/proximity-placement-group/README.md
@@ -115,7 +115,17 @@ module proximityPlacementGroup 'br:bicep/modules/compute.proximity-placement-gro
{
principalId: ''
principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: ''
}
]
tags: {
@@ -178,7 +188,17 @@ module proximityPlacementGroup 'br:bicep/modules/compute.proximity-placement-gro
{
"principalId": "",
"principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
+ "roleDefinitionIdOrName": "Owner"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": "b24988ac-6180-42a0-ab88-20f7382dd24c"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": ""
}
]
},
@@ -237,13 +257,6 @@ module proximityPlacementGroup 'br:bicep/modules/compute.proximity-placement-gro
kind: 'CanNotDelete'
name: 'myCustomLockName'
}
- roleAssignments: [
- {
- principalId: ''
- principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
- }
- ]
tags: {
'hidden-title': 'This is visible in the resource name'
TagA: 'Would you kindly...'
@@ -299,15 +312,6 @@ module proximityPlacementGroup 'br:bicep/modules/compute.proximity-placement-gro
"name": "myCustomLockName"
}
},
- "roleAssignments": {
- "value": [
- {
- "principalId": "",
- "principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
- }
- ]
- },
"tags": {
"value": {
"hidden-title": "This is visible in the resource name",
@@ -348,7 +352,7 @@ module proximityPlacementGroup 'br:bicep/modules/compute.proximity-placement-gro
| [`intent`](#parameter-intent) | object | Specifies the user intent of the proximity placement group. |
| [`location`](#parameter-location) | string | Resource location. |
| [`lock`](#parameter-lock) | object | The lock settings of the service. |
-| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
+| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignments to create. |
| [`tags`](#parameter-tags) | object | Tags of the proximity placement group resource. |
| [`type`](#parameter-type) | string | Specifies the type of the proximity placement group. |
| [`zones`](#parameter-zones) | array | Specifies the Availability Zone where virtual machine, virtual machine scale set or availability set associated with the proximity placement group can be created. |
@@ -416,7 +420,7 @@ The name of the proximity placement group that is being created.
### Parameter: `roleAssignments`
-Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
+Array of role assignments to create.
- Required: No
- Type: array
@@ -429,7 +433,7 @@ Array of role assignment objects that contain the 'roleDefinitionIdOrName' and '
| [`description`](#parameter-roleassignmentsdescription) | No | string | Optional. The description of the role assignment. |
| [`principalId`](#parameter-roleassignmentsprincipalid) | Yes | string | Required. The principal ID of the principal (user/group/identity) to assign the role to. |
| [`principalType`](#parameter-roleassignmentsprincipaltype) | No | string | Optional. The principal type of the assigned principal ID. |
-| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead. |
+| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
### Parameter: `roleAssignments.condition`
@@ -477,7 +481,7 @@ Optional. The principal type of the assigned principal ID.
### Parameter: `roleAssignments.roleDefinitionIdOrName`
-Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.
+Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
- Required: Yes
- Type: string
diff --git a/modules/compute/proximity-placement-group/main.bicep b/modules/compute/proximity-placement-group/main.bicep
index f2f76a2216..45047683d4 100644
--- a/modules/compute/proximity-placement-group/main.bicep
+++ b/modules/compute/proximity-placement-group/main.bicep
@@ -18,7 +18,7 @@ param location string = resourceGroup().location
@description('Optional. The lock settings of the service.')
param lock lockType
-@description('Optional. Array of role assignment objects that contain the \'roleDefinitionIdOrName\' and \'principalId\' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
+@description('Optional. Array of role assignments to create.')
param roleAssignments roleAssignmentType
@description('Optional. Tags of the proximity placement group resource.')
@@ -80,7 +80,7 @@ resource proximityPlacementGroup_lock 'Microsoft.Authorization/locks@2020-05-01'
resource proximityPlacementGroup_roleAssignments 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for (roleAssignment, index) in (roleAssignments ?? []): {
name: guid(proximityPlacementGroup.id, roleAssignment.principalId, roleAssignment.roleDefinitionIdOrName)
properties: {
- roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : roleAssignment.roleDefinitionIdOrName
+ roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : contains(roleAssignment.roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/') ? roleAssignment.roleDefinitionIdOrName : subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleAssignment.roleDefinitionIdOrName)
principalId: roleAssignment.principalId
description: roleAssignment.?description
principalType: roleAssignment.?principalType
@@ -116,7 +116,7 @@ type lockType = {
}?
type roleAssignmentType = {
- @description('Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.')
+ @description('Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
roleDefinitionIdOrName: string
@description('Required. The principal ID of the principal (user/group/identity) to assign the role to.')
diff --git a/modules/compute/proximity-placement-group/main.json b/modules/compute/proximity-placement-group/main.json
index cf403363a2..6d3f4e9580 100644
--- a/modules/compute/proximity-placement-group/main.json
+++ b/modules/compute/proximity-placement-group/main.json
@@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
- "templateHash": "2277527270184526895"
+ "templateHash": "1474026739792714088"
},
"name": "Proximity Placement Groups",
"description": "This module deploys a Proximity Placement Group.",
@@ -46,7 +46,7 @@
"roleDefinitionIdOrName": {
"type": "string",
"metadata": {
- "description": "Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead."
+ "description": "Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
}
},
"principalId": {
@@ -139,7 +139,7 @@
"roleAssignments": {
"$ref": "#/definitions/roleAssignmentType",
"metadata": {
- "description": "Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
+ "description": "Optional. Array of role assignments to create."
}
},
"tags": {
@@ -239,7 +239,7 @@
"scope": "[format('Microsoft.Compute/proximityPlacementGroups/{0}', parameters('name'))]",
"name": "[guid(resourceId('Microsoft.Compute/proximityPlacementGroups', parameters('name')), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId, coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
"properties": {
- "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
+ "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], if(contains(coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)))]",
"principalId": "[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId]",
"description": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'description')]",
"principalType": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'principalType')]",
diff --git a/modules/compute/proximity-placement-group/tests/e2e/max/main.test.bicep b/modules/compute/proximity-placement-group/tests/e2e/max/main.test.bicep
index c996b25ec1..a0e4f0cbc6 100644
--- a/modules/compute/proximity-placement-group/tests/e2e/max/main.test.bicep
+++ b/modules/compute/proximity-placement-group/tests/e2e/max/main.test.bicep
@@ -59,7 +59,17 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
}
roleAssignments: [
{
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')
principalId: nestedDependencies.outputs.managedIdentityPrincipalId
principalType: 'ServicePrincipal'
}
diff --git a/modules/compute/proximity-placement-group/tests/e2e/waf-aligned/main.test.bicep b/modules/compute/proximity-placement-group/tests/e2e/waf-aligned/main.test.bicep
index 498ccb1f1d..db7c9800b0 100644
--- a/modules/compute/proximity-placement-group/tests/e2e/waf-aligned/main.test.bicep
+++ b/modules/compute/proximity-placement-group/tests/e2e/waf-aligned/main.test.bicep
@@ -57,13 +57,6 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
kind: 'CanNotDelete'
name: 'myCustomLockName'
}
- roleAssignments: [
- {
- roleDefinitionIdOrName: 'Reader'
- principalId: nestedDependencies.outputs.managedIdentityPrincipalId
- principalType: 'ServicePrincipal'
- }
- ]
zones: [
'1'
]
diff --git a/modules/compute/virtual-machine-scale-set/README.md b/modules/compute/virtual-machine-scale-set/README.md
index 05c8624341..5e27d6d457 100644
--- a/modules/compute/virtual-machine-scale-set/README.md
+++ b/modules/compute/virtual-machine-scale-set/README.md
@@ -1267,7 +1267,7 @@ module virtualMachineScaleSet 'br:bicep/modules/compute.virtual-machine-scale-se
| [`provisionVMAgent`](#parameter-provisionvmagent) | bool | Indicates whether virtual machine agent should be provisioned on the virtual machine. When this property is not specified in the request body, default behavior is to set it to true. This will ensure that VM Agent is installed on the VM so that extensions can be added to the VM later. |
| [`proximityPlacementGroupResourceId`](#parameter-proximityplacementgroupresourceid) | string | Resource ID of a proximity placement group. |
| [`publicKeys`](#parameter-publickeys) | array | The list of SSH public keys used to authenticate with linux based VMs. |
-| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
+| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignments to create. |
| [`sasTokenValidityLength`](#parameter-sastokenvaliditylength) | string | SAS token validity length to use to download files from storage accounts. Usage: 'PT8H' - valid for 8 hours; 'P5D' - valid for 5 days; 'P1Y' - valid for 1 year. When not provided, the SAS token will be valid for 8 hours. |
| [`scaleInPolicy`](#parameter-scaleinpolicy) | object | Specifies the scale-in policy that decides which virtual machines are chosen for removal when a Virtual Machine Scale Set is scaled-in. |
| [`scaleSetFaultDomain`](#parameter-scalesetfaultdomain) | int | Fault Domain count for each placement group. |
@@ -1808,7 +1808,7 @@ The list of SSH public keys used to authenticate with linux based VMs.
### Parameter: `roleAssignments`
-Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
+Array of role assignments to create.
- Required: No
- Type: array
@@ -1821,7 +1821,7 @@ Array of role assignment objects that contain the 'roleDefinitionIdOrName' and '
| [`description`](#parameter-roleassignmentsdescription) | No | string | Optional. The description of the role assignment. |
| [`principalId`](#parameter-roleassignmentsprincipalid) | Yes | string | Required. The principal ID of the principal (user/group/identity) to assign the role to. |
| [`principalType`](#parameter-roleassignmentsprincipaltype) | No | string | Optional. The principal type of the assigned principal ID. |
-| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead. |
+| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
### Parameter: `roleAssignments.condition`
@@ -1869,7 +1869,7 @@ Optional. The principal type of the assigned principal ID.
### Parameter: `roleAssignments.roleDefinitionIdOrName`
-Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.
+Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
- Required: Yes
- Type: string
diff --git a/modules/compute/virtual-machine-scale-set/main.bicep b/modules/compute/virtual-machine-scale-set/main.bicep
index 977ec6753f..0f845b192c 100644
--- a/modules/compute/virtual-machine-scale-set/main.bicep
+++ b/modules/compute/virtual-machine-scale-set/main.bicep
@@ -46,7 +46,7 @@ param adminPassword string = ''
@description('Optional. Custom data associated to the VM, this value will be automatically converted into base64 to account for the expected VM format.')
param customData string = ''
-@description('Optional. Array of role assignment objects that contain the \'roleDefinitionIdOrName\' and \'principalId\' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
+@description('Optional. Array of role assignments to create.')
param roleAssignments roleAssignmentType
@description('Optional. Fault Domain count for each placement group.')
@@ -627,7 +627,7 @@ resource vmss_diagnosticSettings 'Microsoft.Insights/diagnosticSettings@2021-05-
resource vmss_roleAssignments 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for (roleAssignment, index) in (roleAssignments ?? []): {
name: guid(vmss.id, roleAssignment.principalId, roleAssignment.roleDefinitionIdOrName)
properties: {
- roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : roleAssignment.roleDefinitionIdOrName
+ roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : contains(roleAssignment.roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/') ? roleAssignment.roleDefinitionIdOrName : subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleAssignment.roleDefinitionIdOrName)
principalId: roleAssignment.principalId
description: roleAssignment.?description
principalType: roleAssignment.?principalType
@@ -674,7 +674,7 @@ type lockType = {
}?
type roleAssignmentType = {
- @description('Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.')
+ @description('Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
roleDefinitionIdOrName: string
@description('Required. The principal ID of the principal (user/group/identity) to assign the role to.')
diff --git a/modules/compute/virtual-machine-scale-set/main.json b/modules/compute/virtual-machine-scale-set/main.json
index 1bde1e509e..95643ce69d 100644
--- a/modules/compute/virtual-machine-scale-set/main.json
+++ b/modules/compute/virtual-machine-scale-set/main.json
@@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
- "templateHash": "13725426990469147977"
+ "templateHash": "6314533557974797448"
},
"name": "Virtual Machine Scale Sets",
"description": "This module deploys a Virtual Machine Scale Set.",
@@ -69,7 +69,7 @@
"roleDefinitionIdOrName": {
"type": "string",
"metadata": {
- "description": "Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead."
+ "description": "Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
}
},
"principalId": {
@@ -306,7 +306,7 @@
"roleAssignments": {
"$ref": "#/definitions/roleAssignmentType",
"metadata": {
- "description": "Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
+ "description": "Optional. Array of role assignments to create."
}
},
"scaleSetFaultDomain": {
@@ -974,7 +974,7 @@
"scope": "[format('Microsoft.Compute/virtualMachineScaleSets/{0}', parameters('name'))]",
"name": "[guid(resourceId('Microsoft.Compute/virtualMachineScaleSets', parameters('name')), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId, coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
"properties": {
- "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
+ "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], if(contains(coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)))]",
"principalId": "[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId]",
"description": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'description')]",
"principalType": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'principalType')]",
diff --git a/modules/compute/virtual-machine/README.md b/modules/compute/virtual-machine/README.md
index dfe8bb4ccc..3f0e0fce12 100644
--- a/modules/compute/virtual-machine/README.md
+++ b/modules/compute/virtual-machine/README.md
@@ -271,7 +271,17 @@ module virtualMachine 'br:bicep/modules/compute.virtual-machine:1.0.0' = {
{
principalId: ''
principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: ''
}
]
tags: {
@@ -578,7 +588,17 @@ module virtualMachine 'br:bicep/modules/compute.virtual-machine:1.0.0' = {
{
"principalId": "",
"principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
+ "roleDefinitionIdOrName": "Owner"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": "b24988ac-6180-42a0-ab88-20f7382dd24c"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": ""
}
]
},
@@ -1164,7 +1184,17 @@ module virtualMachine 'br:bicep/modules/compute.virtual-machine:1.0.0' = {
{
principalId: ''
principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: ''
}
]
tags: {
@@ -1491,7 +1521,17 @@ module virtualMachine 'br:bicep/modules/compute.virtual-machine:1.0.0' = {
{
"principalId": "",
"principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
+ "roleDefinitionIdOrName": "Owner"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": "b24988ac-6180-42a0-ab88-20f7382dd24c"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": ""
}
]
},
@@ -1983,7 +2023,7 @@ module virtualMachine 'br:bicep/modules/compute.virtual-machine:1.0.0' = {
| [`provisionVMAgent`](#parameter-provisionvmagent) | bool | Indicates whether virtual machine agent should be provisioned on the virtual machine. When this property is not specified in the request body, default behavior is to set it to true. This will ensure that VM Agent is installed on the VM so that extensions can be added to the VM later. |
| [`proximityPlacementGroupResourceId`](#parameter-proximityplacementgroupresourceid) | string | Resource ID of a proximity placement group. |
| [`publicKeys`](#parameter-publickeys) | array | The list of SSH public keys used to authenticate with linux based VMs. |
-| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
+| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignments to create. |
| [`sasTokenValidityLength`](#parameter-sastokenvaliditylength) | string | SAS token validity length to use to download files from storage accounts. Usage: 'PT8H' - valid for 8 hours; 'P5D' - valid for 5 days; 'P1Y' - valid for 1 year. When not provided, the SAS token will be valid for 8 hours. |
| [`secureBootEnabled`](#parameter-securebootenabled) | bool | Specifies whether secure boot should be enabled on the virtual machine. This parameter is part of the UefiSettings. SecurityType should be set to TrustedLaunch to enable UefiSettings. |
| [`securityType`](#parameter-securitytype) | string | Specifies the SecurityType of the virtual machine. It is set as TrustedLaunch to enable UefiSettings. |
@@ -2509,7 +2549,7 @@ The list of SSH public keys used to authenticate with linux based VMs.
### Parameter: `roleAssignments`
-Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
+Array of role assignments to create.
- Required: No
- Type: array
@@ -2522,7 +2562,7 @@ Array of role assignment objects that contain the 'roleDefinitionIdOrName' and '
| [`description`](#parameter-roleassignmentsdescription) | No | string | Optional. The description of the role assignment. |
| [`principalId`](#parameter-roleassignmentsprincipalid) | Yes | string | Required. The principal ID of the principal (user/group/identity) to assign the role to. |
| [`principalType`](#parameter-roleassignmentsprincipaltype) | No | string | Optional. The principal type of the assigned principal ID. |
-| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead. |
+| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
### Parameter: `roleAssignments.condition`
@@ -2570,7 +2610,7 @@ Optional. The principal type of the assigned principal ID.
### Parameter: `roleAssignments.roleDefinitionIdOrName`
-Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.
+Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
- Required: Yes
- Type: string
diff --git a/modules/compute/virtual-machine/main.bicep b/modules/compute/virtual-machine/main.bicep
index a8660a203e..f908e4b473 100644
--- a/modules/compute/virtual-machine/main.bicep
+++ b/modules/compute/virtual-machine/main.bicep
@@ -189,7 +189,7 @@ param location string = resourceGroup().location
@description('Optional. The lock settings of the service.')
param lock lockType
-@description('Optional. Array of role assignment objects that contain the \'roleDefinitionIdOrName\' and \'principalId\' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
+@description('Optional. Array of role assignments to create.')
param roleAssignments roleAssignmentType
@description('Optional. Tags of the resource.')
@@ -663,7 +663,7 @@ resource vm_lock 'Microsoft.Authorization/locks@2020-05-01' = if (!empty(lock ??
resource vm_roleAssignments 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for (roleAssignment, index) in (roleAssignments ?? []): {
name: guid(vm.id, roleAssignment.principalId, roleAssignment.roleDefinitionIdOrName)
properties: {
- roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : roleAssignment.roleDefinitionIdOrName
+ roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : contains(roleAssignment.roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/') ? roleAssignment.roleDefinitionIdOrName : subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleAssignment.roleDefinitionIdOrName)
principalId: roleAssignment.principalId
description: roleAssignment.?description
principalType: roleAssignment.?principalType
@@ -710,7 +710,7 @@ type lockType = {
}?
type roleAssignmentType = {
- @description('Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.')
+ @description('Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
roleDefinitionIdOrName: string
@description('Required. The principal ID of the principal (user/group/identity) to assign the role to.')
diff --git a/modules/compute/virtual-machine/main.json b/modules/compute/virtual-machine/main.json
index 601f4cfe90..cb696cbdcc 100644
--- a/modules/compute/virtual-machine/main.json
+++ b/modules/compute/virtual-machine/main.json
@@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
- "templateHash": "10032149803242831111"
+ "templateHash": "89939038941992549"
},
"name": "Virtual Machines",
"description": "This module deploys a Virtual Machine with one or multiple NICs and optionally one or multiple public IPs.",
@@ -69,7 +69,7 @@
"roleDefinitionIdOrName": {
"type": "string",
"metadata": {
- "description": "Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead."
+ "description": "Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
}
},
"principalId": {
@@ -602,7 +602,7 @@
"roleAssignments": {
"$ref": "#/definitions/roleAssignmentType",
"metadata": {
- "description": "Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
+ "description": "Optional. Array of role assignments to create."
}
},
"tags": {
@@ -938,7 +938,7 @@
"scope": "[format('Microsoft.Compute/virtualMachines/{0}', parameters('name'))]",
"name": "[guid(resourceId('Microsoft.Compute/virtualMachines', parameters('name')), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId, coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
"properties": {
- "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
+ "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], if(contains(coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)))]",
"principalId": "[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId]",
"description": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'description')]",
"principalType": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'principalType')]",
@@ -1001,7 +1001,7 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
- "templateHash": "10451257297733630828"
+ "templateHash": "11123708724712871468"
}
},
"definitions": {
@@ -1144,7 +1144,7 @@
"roleDefinitionIdOrName": {
"type": "string",
"metadata": {
- "description": "Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead."
+ "description": "Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
}
},
"principalId": {
@@ -1251,7 +1251,7 @@
"roleAssignments": {
"$ref": "#/definitions/roleAssignmentType",
"metadata": {
- "description": "Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
+ "description": "Optional. Array of role assignments to create."
}
}
},
diff --git a/modules/compute/virtual-machine/modules/nested_networkInterface.bicep b/modules/compute/virtual-machine/modules/nested_networkInterface.bicep
index 3126ee1dfb..a7e44aaf79 100644
--- a/modules/compute/virtual-machine/modules/nested_networkInterface.bicep
+++ b/modules/compute/virtual-machine/modules/nested_networkInterface.bicep
@@ -15,7 +15,7 @@ param lock lockType
@description('Optional. The diagnostic settings of the Network Interface.')
param diagnosticSettings diagnosticSettingType
-@description('Optional. Array of role assignment objects that contain the \'roleDefinitionIdOrName\' and \'principalId\' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
+@description('Optional. Array of role assignments to create.')
param roleAssignments roleAssignmentType
var enableReferencedModulesTelemetry = false
@@ -124,7 +124,7 @@ type diagnosticSettingType = {
}[]?
type roleAssignmentType = {
- @description('Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.')
+ @description('Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
roleDefinitionIdOrName: string
@description('Required. The principal ID of the principal (user/group/identity) to assign the role to.')
diff --git a/modules/compute/virtual-machine/tests/e2e/linux/main.test.bicep b/modules/compute/virtual-machine/tests/e2e/linux/main.test.bicep
index a0562afb0a..b4b5e7ba57 100644
--- a/modules/compute/virtual-machine/tests/e2e/linux/main.test.bicep
+++ b/modules/compute/virtual-machine/tests/e2e/linux/main.test.bicep
@@ -281,7 +281,17 @@ module testDeployment '../../../main.bicep' = {
]
roleAssignments: [
{
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')
principalId: nestedDependencies.outputs.managedIdentityPrincipalId
principalType: 'ServicePrincipal'
}
diff --git a/modules/compute/virtual-machine/tests/e2e/windows/main.test.bicep b/modules/compute/virtual-machine/tests/e2e/windows/main.test.bicep
index e095862d0d..7bc8a2c00f 100644
--- a/modules/compute/virtual-machine/tests/e2e/windows/main.test.bicep
+++ b/modules/compute/virtual-machine/tests/e2e/windows/main.test.bicep
@@ -302,7 +302,17 @@ module testDeployment '../../../main.bicep' = {
proximityPlacementGroupResourceId: nestedDependencies.outputs.proximityPlacementGroupResourceId
roleAssignments: [
{
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')
principalId: nestedDependencies.outputs.managedIdentityPrincipalId
principalType: 'ServicePrincipal'
}
diff --git a/modules/container-registry/registry/README.md b/modules/container-registry/registry/README.md
index 9d068e56b9..546708177b 100644
--- a/modules/container-registry/registry/README.md
+++ b/modules/container-registry/registry/README.md
@@ -261,7 +261,17 @@ module registry 'br:bicep/modules/container-registry.registry:1.0.0' = {
{
principalId: ''
principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: ''
}
]
softDeletePolicyDays: 7
@@ -396,7 +406,17 @@ module registry 'br:bicep/modules/container-registry.registry:1.0.0' = {
{
"principalId": "",
"principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
+ "roleDefinitionIdOrName": "Owner"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": "b24988ac-6180-42a0-ab88-20f7382dd24c"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": ""
}
]
},
@@ -602,13 +622,6 @@ module registry 'br:bicep/modules/container-registry.registry:1.0.0' = {
name: ''
}
]
- roleAssignments: [
- {
- principalId: ''
- principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
- }
- ]
softDeletePolicyDays: 7
softDeletePolicyStatus: 'disabled'
tags: {
@@ -736,15 +749,6 @@ module registry 'br:bicep/modules/container-registry.registry:1.0.0' = {
}
]
},
- "roleAssignments": {
- "value": [
- {
- "principalId": "",
- "principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
- }
- ]
- },
"softDeletePolicyDays": {
"value": 7
},
@@ -811,7 +815,7 @@ module registry 'br:bicep/modules/container-registry.registry:1.0.0' = {
| [`replications`](#parameter-replications) | array | All replications to create. |
| [`retentionPolicyDays`](#parameter-retentionpolicydays) | int | The number of days to retain an untagged manifest after which it gets purged. |
| [`retentionPolicyStatus`](#parameter-retentionpolicystatus) | string | The value that indicates whether the retention policy is enabled or not. |
-| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
+| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignments to create. |
| [`softDeletePolicyDays`](#parameter-softdeletepolicydays) | int | The number of days after which a soft-deleted item is permanently deleted. |
| [`softDeletePolicyStatus`](#parameter-softdeletepolicystatus) | string | Soft Delete policy status. Default is disabled. |
| [`tags`](#parameter-tags) | object | Tags of the resource. |
@@ -1175,7 +1179,7 @@ Configuration details for private endpoints. For security reasons, it is recomme
| [`name`](#parameter-privateendpointsname) | No | string | Optional. The name of the private endpoint. |
| [`privateDnsZoneGroupName`](#parameter-privateendpointsprivatednszonegroupname) | No | string | Optional. The name of the private DNS zone group to create if privateDnsZoneResourceIds were provided. |
| [`privateDnsZoneResourceIds`](#parameter-privateendpointsprivatednszoneresourceids) | No | array | Optional. The private DNS zone groups to associate the private endpoint with. A DNS zone group can support up to 5 DNS zones. |
-| [`roleAssignments`](#parameter-privateendpointsroleassignments) | No | array | Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
+| [`roleAssignments`](#parameter-privateendpointsroleassignments) | No | array | Optional. Array of role assignments to create. |
| [`service`](#parameter-privateendpointsservice) | No | string | Optional. The service (sub-) type to deploy the private endpoint for. For example "vault" or "blob". |
| [`subnetResourceId`](#parameter-privateendpointssubnetresourceid) | Yes | string | Required. Resource ID of the subnet where the endpoint needs to be created. |
| [`tags`](#parameter-privateendpointstags) | No | object | Optional. Tags to be applied on all resources/resource groups in this deployment. |
@@ -1327,7 +1331,7 @@ Optional. The private DNS zone groups to associate the private endpoint with. A
### Parameter: `privateEndpoints.roleAssignments`
-Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
+Optional. Array of role assignments to create.
- Required: No
- Type: array
@@ -1412,7 +1416,7 @@ The value that indicates whether the retention policy is enabled or not.
### Parameter: `roleAssignments`
-Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
+Array of role assignments to create.
- Required: No
- Type: array
@@ -1425,7 +1429,7 @@ Array of role assignment objects that contain the 'roleDefinitionIdOrName' and '
| [`description`](#parameter-roleassignmentsdescription) | No | string | Optional. The description of the role assignment. |
| [`principalId`](#parameter-roleassignmentsprincipalid) | Yes | string | Required. The principal ID of the principal (user/group/identity) to assign the role to. |
| [`principalType`](#parameter-roleassignmentsprincipaltype) | No | string | Optional. The principal type of the assigned principal ID. |
-| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead. |
+| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
### Parameter: `roleAssignments.condition`
@@ -1473,7 +1477,7 @@ Optional. The principal type of the assigned principal ID.
### Parameter: `roleAssignments.roleDefinitionIdOrName`
-Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.
+Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
- Required: Yes
- Type: string
diff --git a/modules/container-registry/registry/main.bicep b/modules/container-registry/registry/main.bicep
index adb6b45d84..ff38067ac0 100644
--- a/modules/container-registry/registry/main.bicep
+++ b/modules/container-registry/registry/main.bicep
@@ -13,7 +13,7 @@ param acrAdminUserEnabled bool = false
@description('Optional. Location for all resources.')
param location string = resourceGroup().location
-@description('Optional. Array of role assignment objects that contain the \'roleDefinitionIdOrName\' and \'principalId\' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
+@description('Optional. Array of role assignments to create.')
param roleAssignments roleAssignmentType
@description('Optional. Tier of your Azure container registry.')
@@ -326,7 +326,7 @@ resource registry_diagnosticSettings 'Microsoft.Insights/diagnosticSettings@2021
resource registry_roleAssignments 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for (roleAssignment, index) in (roleAssignments ?? []): {
name: guid(registry.id, roleAssignment.principalId, roleAssignment.roleDefinitionIdOrName)
properties: {
- roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : roleAssignment.roleDefinitionIdOrName
+ roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : contains(roleAssignment.roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/') ? roleAssignment.roleDefinitionIdOrName : subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleAssignment.roleDefinitionIdOrName)
principalId: roleAssignment.principalId
description: roleAssignment.?description
principalType: roleAssignment.?principalType
@@ -400,7 +400,7 @@ type lockType = {
}?
type roleAssignmentType = {
- @description('Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.')
+ @description('Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
roleDefinitionIdOrName: string
@description('Required. The principal ID of the principal (user/group/identity) to assign the role to.')
@@ -477,7 +477,7 @@ type privateEndpointType = {
@description('Optional. Specify the type of lock.')
lock: lockType
- @description('Optional. Array of role assignment objects that contain the \'roleDefinitionIdOrName\' and \'principalId\' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
+ @description('Optional. Array of role assignments to create.')
roleAssignments: roleAssignmentType
@description('Optional. Tags to be applied on all resources/resource groups in this deployment.')
diff --git a/modules/container-registry/registry/main.json b/modules/container-registry/registry/main.json
index 40951db6fa..39a04d3a66 100644
--- a/modules/container-registry/registry/main.json
+++ b/modules/container-registry/registry/main.json
@@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
- "templateHash": "601165591390231173"
+ "templateHash": "6862455028328660677"
},
"name": "Azure Container Registries (ACR)",
"description": "This module deploys an Azure Container Registry (ACR).",
@@ -69,7 +69,7 @@
"roleDefinitionIdOrName": {
"type": "string",
"metadata": {
- "description": "Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead."
+ "description": "Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
}
},
"principalId": {
@@ -274,7 +274,7 @@
"roleAssignments": {
"$ref": "#/definitions/roleAssignmentType",
"metadata": {
- "description": "Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
+ "description": "Optional. Array of role assignments to create."
}
},
"tags": {
@@ -467,7 +467,7 @@
"roleAssignments": {
"$ref": "#/definitions/roleAssignmentType",
"metadata": {
- "description": "Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
+ "description": "Optional. Array of role assignments to create."
}
},
"acrSku": {
@@ -847,7 +847,7 @@
"scope": "[format('Microsoft.ContainerRegistry/registries/{0}', parameters('name'))]",
"name": "[guid(resourceId('Microsoft.ContainerRegistry/registries', parameters('name')), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId, coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
"properties": {
- "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
+ "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], if(contains(coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)))]",
"principalId": "[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId]",
"description": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'description')]",
"principalType": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'principalType')]",
diff --git a/modules/container-registry/registry/tests/e2e/max/main.test.bicep b/modules/container-registry/registry/tests/e2e/max/main.test.bicep
index d846a7b696..767cc9ee2e 100644
--- a/modules/container-registry/registry/tests/e2e/max/main.test.bicep
+++ b/modules/container-registry/registry/tests/e2e/max/main.test.bicep
@@ -124,7 +124,17 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
]
roleAssignments: [
{
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')
principalId: nestedDependencies.outputs.managedIdentityPrincipalId
principalType: 'ServicePrincipal'
}
diff --git a/modules/container-registry/registry/tests/e2e/waf-aligned/main.test.bicep b/modules/container-registry/registry/tests/e2e/waf-aligned/main.test.bicep
index f0bf4552b3..7f6dd675d7 100644
--- a/modules/container-registry/registry/tests/e2e/waf-aligned/main.test.bicep
+++ b/modules/container-registry/registry/tests/e2e/waf-aligned/main.test.bicep
@@ -122,13 +122,6 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
name: nestedDependencies.outputs.pairedRegionName
}
]
- roleAssignments: [
- {
- roleDefinitionIdOrName: 'Reader'
- principalId: nestedDependencies.outputs.managedIdentityPrincipalId
- principalType: 'ServicePrincipal'
- }
- ]
managedIdentities: {
systemAssigned: true
userAssignedResourceIds: [
diff --git a/modules/container-service/managed-cluster/README.md b/modules/container-service/managed-cluster/README.md
index fe444ca1da..dd804e181f 100644
--- a/modules/container-service/managed-cluster/README.md
+++ b/modules/container-service/managed-cluster/README.md
@@ -21,7 +21,7 @@ This module deploys an Azure Kubernetes Service (AKS) Managed Cluster.
| `Microsoft.ContainerService/managedClusters/agentPools` | [2023-07-02-preview](https://learn.microsoft.com/en-us/azure/templates/Microsoft.ContainerService/2023-07-02-preview/managedClusters/agentPools) |
| `Microsoft.Insights/diagnosticSettings` | [2021-05-01-preview](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Insights/2021-05-01-preview/diagnosticSettings) |
| `Microsoft.KubernetesConfiguration/extensions` | [2022-03-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.KubernetesConfiguration/2022-03-01/extensions) |
-| `Microsoft.KubernetesConfiguration/fluxConfigurations` | [2022-03-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.KubernetesConfiguration/2022-03-01/fluxConfigurations) |
+| `Microsoft.KubernetesConfiguration/fluxConfigurations` | [2023-05-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.KubernetesConfiguration/fluxConfigurations) |
## Usage examples
@@ -234,7 +234,17 @@ module managedCluster 'br:bicep/modules/container-service.managed-cluster:1.0.0'
{
principalId: ''
principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: ''
}
]
tags: {
@@ -501,7 +511,17 @@ module managedCluster 'br:bicep/modules/container-service.managed-cluster:1.0.0'
{
"principalId": "",
"principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
+ "roleDefinitionIdOrName": "Owner"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": "b24988ac-6180-42a0-ab88-20f7382dd24c"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": ""
}
]
},
@@ -701,7 +721,17 @@ module managedCluster 'br:bicep/modules/container-service.managed-cluster:1.0.0'
{
principalId: ''
principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: ''
}
]
tags: {
@@ -838,7 +868,17 @@ module managedCluster 'br:bicep/modules/container-service.managed-cluster:1.0.0'
{
"principalId": "",
"principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
+ "roleDefinitionIdOrName": "Owner"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": "b24988ac-6180-42a0-ab88-20f7382dd24c"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": ""
}
]
},
@@ -1230,7 +1270,7 @@ module managedCluster 'br:bicep/modules/container-service.managed-cluster:1.0.0'
| [`podIdentityProfileUserAssignedIdentities`](#parameter-podidentityprofileuserassignedidentities) | array | The pod identities to use in the cluster. |
| [`podIdentityProfileUserAssignedIdentityExceptions`](#parameter-podidentityprofileuserassignedidentityexceptions) | array | The pod identity exceptions to allow. |
| [`privateDNSZone`](#parameter-privatednszone) | string | Private DNS Zone configuration. Set to 'system' and AKS will create a private DNS zone in the node resource group. Set to '' to disable private DNS Zone creation and use public DNS. Supply the resource ID here of an existing Private DNS zone to use an existing zone. |
-| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
+| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignments to create. |
| [`serviceCidr`](#parameter-servicecidr) | string | A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. |
| [`skuTier`](#parameter-skutier) | string | Tier of a managed cluster SKU. - Free or Standard. |
| [`sshPublicKey`](#parameter-sshpublickey) | string | Specifies the SSH RSA public key string for the Linux nodes. |
@@ -2116,7 +2156,7 @@ Private DNS Zone configuration. Set to 'system' and AKS will create a private DN
### Parameter: `roleAssignments`
-Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
+Array of role assignments to create.
- Required: No
- Type: array
@@ -2129,7 +2169,7 @@ Array of role assignment objects that contain the 'roleDefinitionIdOrName' and '
| [`description`](#parameter-roleassignmentsdescription) | No | string | Optional. The description of the role assignment. |
| [`principalId`](#parameter-roleassignmentsprincipalid) | Yes | string | Required. The principal ID of the principal (user/group/identity) to assign the role to. |
| [`principalType`](#parameter-roleassignmentsprincipaltype) | No | string | Optional. The principal type of the assigned principal ID. |
-| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead. |
+| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
### Parameter: `roleAssignments.condition`
@@ -2177,7 +2217,7 @@ Optional. The principal type of the assigned principal ID.
### Parameter: `roleAssignments.roleDefinitionIdOrName`
-Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.
+Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
- Required: Yes
- Type: string
diff --git a/modules/container-service/managed-cluster/main.bicep b/modules/container-service/managed-cluster/main.bicep
index 304a5c48e6..bd9f8294c5 100644
--- a/modules/container-service/managed-cluster/main.bicep
+++ b/modules/container-service/managed-cluster/main.bicep
@@ -323,7 +323,7 @@ param monitoringWorkspaceId string = ''
@description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).')
param enableDefaultTelemetry bool = true
-@description('Optional. Array of role assignment objects that contain the \'roleDefinitionIdOrName\' and \'principalId\' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
+@description('Optional. Array of role assignments to create.')
param roleAssignments roleAssignmentType
@description('Optional. The lock settings of the service.')
@@ -683,7 +683,7 @@ resource managedCluster_diagnosticSettings 'Microsoft.Insights/diagnosticSetting
resource managedCluster_roleAssignments 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for (roleAssignment, index) in (roleAssignments ?? []): {
name: guid(managedCluster.id, roleAssignment.principalId, roleAssignment.roleDefinitionIdOrName)
properties: {
- roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : roleAssignment.roleDefinitionIdOrName
+ roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : contains(roleAssignment.roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/') ? roleAssignment.roleDefinitionIdOrName : subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleAssignment.roleDefinitionIdOrName)
principalId: roleAssignment.principalId
description: roleAssignment.?description
principalType: roleAssignment.?principalType
@@ -765,7 +765,7 @@ type lockType = {
}?
type roleAssignmentType = {
- @description('Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.')
+ @description('Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
roleDefinitionIdOrName: string
@description('Required. The principal ID of the principal (user/group/identity) to assign the role to.')
diff --git a/modules/container-service/managed-cluster/main.json b/modules/container-service/managed-cluster/main.json
index e6da45a8e2..ae0399022d 100644
--- a/modules/container-service/managed-cluster/main.json
+++ b/modules/container-service/managed-cluster/main.json
@@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
- "templateHash": "4013697482173328246"
+ "templateHash": "8572950365871080651"
},
"name": "Azure Kubernetes Service (AKS) Managed Clusters",
"description": "This module deploys an Azure Kubernetes Service (AKS) Managed Cluster.",
@@ -69,7 +69,7 @@
"roleDefinitionIdOrName": {
"type": "string",
"metadata": {
- "description": "Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead."
+ "description": "Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
}
},
"principalId": {
@@ -923,7 +923,7 @@
"roleAssignments": {
"$ref": "#/definitions/roleAssignmentType",
"metadata": {
- "description": "Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
+ "description": "Optional. Array of role assignments to create."
}
},
"lock": {
@@ -1249,7 +1249,7 @@
"scope": "[format('Microsoft.ContainerService/managedClusters/{0}', parameters('name'))]",
"name": "[guid(resourceId('Microsoft.ContainerService/managedClusters', parameters('name')), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId, coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
"properties": {
- "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
+ "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], if(contains(coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)))]",
"principalId": "[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId]",
"description": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'description')]",
"principalType": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'principalType')]",
@@ -1804,7 +1804,7 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
- "templateHash": "18265527122738367400"
+ "templateHash": "548642834195454661"
},
"name": "Kubernetes Configuration Extensions",
"description": "This module deploys a Kubernetes Configuration Extension.",
@@ -1967,7 +1967,7 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
- "templateHash": "8985718648814286209"
+ "templateHash": "10031296768791737313"
},
"name": "Kubernetes Configuration Flux Configurations",
"description": "This module deploys a Kubernetes Configuration Flux Configuration.",
@@ -2023,9 +2023,8 @@
},
"kustomizations": {
"type": "object",
- "defaultValue": {},
"metadata": {
- "description": "Optional. Array of kustomizations used to reconcile the artifact pulled by the source type on the cluster."
+ "description": "Required. Array of kustomizations used to reconcile the artifact pulled by the source type on the cluster."
}
},
"namespace": {
@@ -2079,14 +2078,14 @@
},
{
"type": "Microsoft.KubernetesConfiguration/fluxConfigurations",
- "apiVersion": "2022-03-01",
+ "apiVersion": "2023-05-01",
"scope": "[format('Microsoft.ContainerService/managedClusters/{0}', parameters('clusterName'))]",
"name": "[parameters('name')]",
"properties": {
"bucket": "[if(not(empty(parameters('bucket'))), parameters('bucket'), null())]",
"configurationProtectedSettings": "[if(not(empty(parameters('configurationProtectedSettings'))), parameters('configurationProtectedSettings'), createObject())]",
"gitRepository": "[if(not(empty(parameters('gitRepository'))), parameters('gitRepository'), null())]",
- "kustomizations": "[if(not(empty(parameters('kustomizations'))), parameters('kustomizations'), createObject())]",
+ "kustomizations": "[parameters('kustomizations')]",
"namespace": "[parameters('namespace')]",
"scope": "[parameters('scope')]",
"sourceKind": "[parameters('sourceKind')]",
diff --git a/modules/container-service/managed-cluster/tests/e2e/azure/main.test.bicep b/modules/container-service/managed-cluster/tests/e2e/azure/main.test.bicep
index 32f8c42ed3..c5cc686316 100644
--- a/modules/container-service/managed-cluster/tests/e2e/azure/main.test.bicep
+++ b/modules/container-service/managed-cluster/tests/e2e/azure/main.test.bicep
@@ -200,7 +200,17 @@ module testDeployment '../../../main.bicep' = {
}
roleAssignments: [
{
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')
principalId: nestedDependencies.outputs.managedIdentityPrincipalId
principalType: 'ServicePrincipal'
}
diff --git a/modules/container-service/managed-cluster/tests/e2e/kubenet/main.test.bicep b/modules/container-service/managed-cluster/tests/e2e/kubenet/main.test.bicep
index 9c91011d20..cede954b18 100644
--- a/modules/container-service/managed-cluster/tests/e2e/kubenet/main.test.bicep
+++ b/modules/container-service/managed-cluster/tests/e2e/kubenet/main.test.bicep
@@ -151,7 +151,17 @@ module testDeployment '../../../main.bicep' = {
]
roleAssignments: [
{
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')
principalId: nestedDependencies.outputs.managedIdentityPrincipalId
principalType: 'ServicePrincipal'
}
diff --git a/modules/data-factory/factory/README.md b/modules/data-factory/factory/README.md
index 400baf8e89..c04ef52978 100644
--- a/modules/data-factory/factory/README.md
+++ b/modules/data-factory/factory/README.md
@@ -181,7 +181,17 @@ module factory 'br:bicep/modules/data-factory.factory:1.0.0' = {
{
principalId: ''
principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: ''
}
]
tags: {
@@ -313,7 +323,17 @@ module factory 'br:bicep/modules/data-factory.factory:1.0.0' = {
{
"principalId": "",
"principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
+ "roleDefinitionIdOrName": "Owner"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": "b24988ac-6180-42a0-ab88-20f7382dd24c"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": ""
}
]
},
@@ -423,13 +443,6 @@ module factory 'br:bicep/modules/data-factory.factory:1.0.0' = {
}
}
]
- roleAssignments: [
- {
- principalId: ''
- principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
- }
- ]
tags: {
Environment: 'Non-Prod'
'hidden-title': 'This is visible in the resource name'
@@ -554,15 +567,6 @@ module factory 'br:bicep/modules/data-factory.factory:1.0.0' = {
}
]
},
- "roleAssignments": {
- "value": [
- {
- "principalId": "",
- "principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
- }
- ]
- },
"tags": {
"value": {
"Environment": "Non-Prod",
@@ -611,7 +615,7 @@ module factory 'br:bicep/modules/data-factory.factory:1.0.0' = {
| [`managedVirtualNetworkName`](#parameter-managedvirtualnetworkname) | string | The name of the Managed Virtual Network. |
| [`privateEndpoints`](#parameter-privateendpoints) | array | Configuration Details for private endpoints. For security reasons, it is recommended to use private endpoints whenever possible. |
| [`publicNetworkAccess`](#parameter-publicnetworkaccess) | string | Whether or not public network access is allowed for this resource. For security reasons it should be disabled. If not specified, it will be disabled by default if private endpoints are set. |
-| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
+| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignments to create. |
| [`tags`](#parameter-tags) | object | Tags of the resource. |
### Parameter: `customerManagedKey`
@@ -955,7 +959,7 @@ Configuration Details for private endpoints. For security reasons, it is recomme
| [`name`](#parameter-privateendpointsname) | No | string | Optional. The name of the private endpoint. |
| [`privateDnsZoneGroupName`](#parameter-privateendpointsprivatednszonegroupname) | No | string | Optional. The name of the private DNS zone group to create if privateDnsZoneResourceIds were provided. |
| [`privateDnsZoneResourceIds`](#parameter-privateendpointsprivatednszoneresourceids) | No | array | Optional. The private DNS zone groups to associate the private endpoint with. A DNS zone group can support up to 5 DNS zones. |
-| [`roleAssignments`](#parameter-privateendpointsroleassignments) | No | array | Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
+| [`roleAssignments`](#parameter-privateendpointsroleassignments) | No | array | Optional. Array of role assignments to create. |
| [`service`](#parameter-privateendpointsservice) | No | string | Optional. The service (sub-) type to deploy the private endpoint for. For example "vault" or "blob". |
| [`subnetResourceId`](#parameter-privateendpointssubnetresourceid) | Yes | string | Required. Resource ID of the subnet where the endpoint needs to be created. |
| [`tags`](#parameter-privateendpointstags) | No | object | Optional. Tags to be applied on all resources/resource groups in this deployment. |
@@ -1107,7 +1111,7 @@ Optional. The private DNS zone groups to associate the private endpoint with. A
### Parameter: `privateEndpoints.roleAssignments`
-Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
+Optional. Array of role assignments to create.
- Required: No
- Type: array
@@ -1150,7 +1154,7 @@ Whether or not public network access is allowed for this resource. For security
### Parameter: `roleAssignments`
-Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
+Array of role assignments to create.
- Required: No
- Type: array
@@ -1163,7 +1167,7 @@ Array of role assignment objects that contain the 'roleDefinitionIdOrName' and '
| [`description`](#parameter-roleassignmentsdescription) | No | string | Optional. The description of the role assignment. |
| [`principalId`](#parameter-roleassignmentsprincipalid) | Yes | string | Required. The principal ID of the principal (user/group/identity) to assign the role to. |
| [`principalType`](#parameter-roleassignmentsprincipaltype) | No | string | Optional. The principal type of the assigned principal ID. |
-| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead. |
+| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
### Parameter: `roleAssignments.condition`
@@ -1211,7 +1215,7 @@ Optional. The principal type of the assigned principal ID.
### Parameter: `roleAssignments.roleDefinitionIdOrName`
-Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.
+Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
- Required: Yes
- Type: string
diff --git a/modules/data-factory/factory/main.bicep b/modules/data-factory/factory/main.bicep
index d6c26ec855..f0718db857 100644
--- a/modules/data-factory/factory/main.bicep
+++ b/modules/data-factory/factory/main.bicep
@@ -70,7 +70,7 @@ param privateEndpoints privateEndpointType
@description('Optional. The customer managed key definition.')
param customerManagedKey customerManagedKeyType
-@description('Optional. Array of role assignment objects that contain the \'roleDefinitionIdOrName\' and \'principalId\' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
+@description('Optional. Array of role assignments to create.')
param roleAssignments roleAssignmentType
@description('Optional. Tags of the resource.')
@@ -216,7 +216,7 @@ resource dataFactory_diagnosticSettings 'Microsoft.Insights/diagnosticSettings@2
resource dataFactory_roleAssignments 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for (roleAssignment, index) in (roleAssignments ?? []): {
name: guid(dataFactory.id, roleAssignment.principalId, roleAssignment.roleDefinitionIdOrName)
properties: {
- roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : roleAssignment.roleDefinitionIdOrName
+ roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : contains(roleAssignment.roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/') ? roleAssignment.roleDefinitionIdOrName : subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleAssignment.roleDefinitionIdOrName)
principalId: roleAssignment.principalId
description: roleAssignment.?description
principalType: roleAssignment.?principalType
@@ -287,7 +287,7 @@ type lockType = {
}?
type roleAssignmentType = {
- @description('Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.')
+ @description('Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
roleDefinitionIdOrName: string
@description('Required. The principal ID of the principal (user/group/identity) to assign the role to.')
@@ -364,7 +364,7 @@ type privateEndpointType = {
@description('Optional. Specify the type of lock.')
lock: lockType
- @description('Optional. Array of role assignment objects that contain the \'roleDefinitionIdOrName\' and \'principalId\' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
+ @description('Optional. Array of role assignments to create.')
roleAssignments: roleAssignmentType
@description('Optional. Tags to be applied on all resources/resource groups in this deployment.')
diff --git a/modules/data-factory/factory/main.json b/modules/data-factory/factory/main.json
index e57d5fc9a6..2c237602dc 100644
--- a/modules/data-factory/factory/main.json
+++ b/modules/data-factory/factory/main.json
@@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
- "templateHash": "1174493614082908540"
+ "templateHash": "13040115678809105758"
},
"name": "Data Factories",
"description": "This module deploys a Data Factory.",
@@ -69,7 +69,7 @@
"roleDefinitionIdOrName": {
"type": "string",
"metadata": {
- "description": "Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead."
+ "description": "Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
}
},
"principalId": {
@@ -274,7 +274,7 @@
"roleAssignments": {
"$ref": "#/definitions/roleAssignmentType",
"metadata": {
- "description": "Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
+ "description": "Optional. Array of role assignments to create."
}
},
"tags": {
@@ -591,7 +591,7 @@
"roleAssignments": {
"$ref": "#/definitions/roleAssignmentType",
"metadata": {
- "description": "Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
+ "description": "Optional. Array of role assignments to create."
}
},
"tags": {
@@ -732,7 +732,7 @@
"scope": "[format('Microsoft.DataFactory/factories/{0}', parameters('name'))]",
"name": "[guid(resourceId('Microsoft.DataFactory/factories', parameters('name')), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId, coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
"properties": {
- "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
+ "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], if(contains(coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)))]",
"principalId": "[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId]",
"description": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'description')]",
"principalType": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'principalType')]",
diff --git a/modules/data-factory/factory/tests/e2e/max/main.test.bicep b/modules/data-factory/factory/tests/e2e/max/main.test.bicep
index a04cfe8f10..7134060c90 100644
--- a/modules/data-factory/factory/tests/e2e/max/main.test.bicep
+++ b/modules/data-factory/factory/tests/e2e/max/main.test.bicep
@@ -142,7 +142,17 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
]
roleAssignments: [
{
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')
principalId: nestedDependencies.outputs.managedIdentityPrincipalId
principalType: 'ServicePrincipal'
}
diff --git a/modules/data-factory/factory/tests/e2e/waf-aligned/main.test.bicep b/modules/data-factory/factory/tests/e2e/waf-aligned/main.test.bicep
index 28b941a4e4..1a7cb59527 100644
--- a/modules/data-factory/factory/tests/e2e/waf-aligned/main.test.bicep
+++ b/modules/data-factory/factory/tests/e2e/waf-aligned/main.test.bicep
@@ -140,13 +140,6 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
}
}
]
- roleAssignments: [
- {
- roleDefinitionIdOrName: 'Reader'
- principalId: nestedDependencies.outputs.managedIdentityPrincipalId
- principalType: 'ServicePrincipal'
- }
- ]
managedIdentities: {
systemAssigned: true
userAssignedResourceIds: [
diff --git a/modules/data-protection/backup-vault/README.md b/modules/data-protection/backup-vault/README.md
index a7771b8b43..6ade55fb30 100644
--- a/modules/data-protection/backup-vault/README.md
+++ b/modules/data-protection/backup-vault/README.md
@@ -171,7 +171,17 @@ module backupVault 'br:bicep/modules/data-protection.backup-vault:1.0.0' = {
{
principalId: ''
principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: ''
}
]
tags: {
@@ -286,7 +296,17 @@ module backupVault 'br:bicep/modules/data-protection.backup-vault:1.0.0' = {
{
"principalId": "",
"principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
+ "roleDefinitionIdOrName": "Owner"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": "b24988ac-6180-42a0-ab88-20f7382dd24c"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": ""
}
]
},
@@ -391,13 +411,6 @@ module backupVault 'br:bicep/modules/data-protection.backup-vault:1.0.0' = {
managedIdentities: {
systemAssigned: true
}
- roleAssignments: [
- {
- principalId: ''
- principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
- }
- ]
tags: {
Environment: 'Non-Prod'
'hidden-title': 'This is visible in the resource name'
@@ -505,15 +518,6 @@ module backupVault 'br:bicep/modules/data-protection.backup-vault:1.0.0' = {
"systemAssigned": true
}
},
- "roleAssignments": {
- "value": [
- {
- "principalId": "",
- "principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
- }
- ]
- },
"tags": {
"value": {
"Environment": "Non-Prod",
@@ -549,7 +553,7 @@ module backupVault 'br:bicep/modules/data-protection.backup-vault:1.0.0' = {
| [`location`](#parameter-location) | string | Location for all resources. |
| [`lock`](#parameter-lock) | object | The lock settings of the service. |
| [`managedIdentities`](#parameter-managedidentities) | object | The managed identity definition for this resource. |
-| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
+| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignments to create. |
| [`securitySettings`](#parameter-securitysettings) | object | Security settings for the backup vault. |
| [`tags`](#parameter-tags) | object | Tags of the Recovery Service Vault resource. |
| [`type`](#parameter-type) | string | The vault redundancy level to use. |
@@ -664,7 +668,7 @@ Name of the Backup Vault.
### Parameter: `roleAssignments`
-Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
+Array of role assignments to create.
- Required: No
- Type: array
@@ -677,7 +681,7 @@ Array of role assignment objects that contain the 'roleDefinitionIdOrName' and '
| [`description`](#parameter-roleassignmentsdescription) | No | string | Optional. The description of the role assignment. |
| [`principalId`](#parameter-roleassignmentsprincipalid) | Yes | string | Required. The principal ID of the principal (user/group/identity) to assign the role to. |
| [`principalType`](#parameter-roleassignmentsprincipaltype) | No | string | Optional. The principal type of the assigned principal ID. |
-| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead. |
+| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
### Parameter: `roleAssignments.condition`
@@ -725,7 +729,7 @@ Optional. The principal type of the assigned principal ID.
### Parameter: `roleAssignments.roleDefinitionIdOrName`
-Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.
+Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
- Required: Yes
- Type: string
diff --git a/modules/data-protection/backup-vault/main.bicep b/modules/data-protection/backup-vault/main.bicep
index 942fbcfb34..f337814938 100644
--- a/modules/data-protection/backup-vault/main.bicep
+++ b/modules/data-protection/backup-vault/main.bicep
@@ -11,7 +11,7 @@ param enableDefaultTelemetry bool = true
@description('Optional. Location for all resources.')
param location string = resourceGroup().location
-@description('Optional. Array of role assignment objects that contain the \'roleDefinitionIdOrName\' and \'principalId\' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
+@description('Optional. Array of role assignments to create.')
param roleAssignments roleAssignmentType
@description('Optional. The lock settings of the service.')
@@ -128,7 +128,7 @@ resource backupVault_lock 'Microsoft.Authorization/locks@2020-05-01' = if (!empt
resource backupVault_roleAssignments 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for (roleAssignment, index) in (roleAssignments ?? []): {
name: guid(backupVault.id, roleAssignment.principalId, roleAssignment.roleDefinitionIdOrName)
properties: {
- roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : roleAssignment.roleDefinitionIdOrName
+ roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : contains(roleAssignment.roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/') ? roleAssignment.roleDefinitionIdOrName : subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleAssignment.roleDefinitionIdOrName)
principalId: roleAssignment.principalId
description: roleAssignment.?description
principalType: roleAssignment.?principalType
@@ -172,7 +172,7 @@ type lockType = {
}?
type roleAssignmentType = {
- @description('Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.')
+ @description('Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
roleDefinitionIdOrName: string
@description('Required. The principal ID of the principal (user/group/identity) to assign the role to.')
diff --git a/modules/data-protection/backup-vault/main.json b/modules/data-protection/backup-vault/main.json
index 8b0c13673f..487583bb38 100644
--- a/modules/data-protection/backup-vault/main.json
+++ b/modules/data-protection/backup-vault/main.json
@@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
- "templateHash": "8279564580875716128"
+ "templateHash": "11737453267233569722"
},
"name": "Data Protection Backup Vaults",
"description": "This module deploys a Data Protection Backup Vault.",
@@ -59,7 +59,7 @@
"roleDefinitionIdOrName": {
"type": "string",
"metadata": {
- "description": "Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead."
+ "description": "Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
}
},
"principalId": {
@@ -142,7 +142,7 @@
"roleAssignments": {
"$ref": "#/definitions/roleAssignmentType",
"metadata": {
- "description": "Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
+ "description": "Optional. Array of role assignments to create."
}
},
"lock": {
@@ -297,7 +297,7 @@
"scope": "[format('Microsoft.DataProtection/backupVaults/{0}', parameters('name'))]",
"name": "[guid(resourceId('Microsoft.DataProtection/backupVaults', parameters('name')), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId, coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
"properties": {
- "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
+ "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], if(contains(coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)))]",
"principalId": "[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId]",
"description": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'description')]",
"principalType": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'principalType')]",
diff --git a/modules/data-protection/backup-vault/tests/e2e/max/main.test.bicep b/modules/data-protection/backup-vault/tests/e2e/max/main.test.bicep
index 4d25b7b7c4..588b2e0c20 100644
--- a/modules/data-protection/backup-vault/tests/e2e/max/main.test.bicep
+++ b/modules/data-protection/backup-vault/tests/e2e/max/main.test.bicep
@@ -55,7 +55,17 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
name: '${namePrefix}${serviceShort}001'
roleAssignments: [
{
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')
principalId: nestedDependencies.outputs.managedIdentityPrincipalId
principalType: 'ServicePrincipal'
}
diff --git a/modules/data-protection/backup-vault/tests/e2e/waf-aligned/main.test.bicep b/modules/data-protection/backup-vault/tests/e2e/waf-aligned/main.test.bicep
index 8d44a80490..1bcb119964 100644
--- a/modules/data-protection/backup-vault/tests/e2e/waf-aligned/main.test.bicep
+++ b/modules/data-protection/backup-vault/tests/e2e/waf-aligned/main.test.bicep
@@ -53,13 +53,6 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
params: {
enableDefaultTelemetry: enableDefaultTelemetry
name: '${namePrefix}${serviceShort}001'
- roleAssignments: [
- {
- roleDefinitionIdOrName: 'Reader'
- principalId: nestedDependencies.outputs.managedIdentityPrincipalId
- principalType: 'ServicePrincipal'
- }
- ]
azureMonitorAlertSettingsAlertsForAllJobFailures: 'Disabled'
managedIdentities: {
systemAssigned: true
diff --git a/modules/databricks/access-connector/README.md b/modules/databricks/access-connector/README.md
index 56b4202f0c..02ebe4193a 100644
--- a/modules/databricks/access-connector/README.md
+++ b/modules/databricks/access-connector/README.md
@@ -110,7 +110,17 @@ module accessConnector 'br:bicep/modules/databricks.access-connector:1.0.0' = {
{
principalId: ''
principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: ''
}
]
tags: {
@@ -164,7 +174,17 @@ module accessConnector 'br:bicep/modules/databricks.access-connector:1.0.0' = {
{
"principalId": "",
"principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
+ "roleDefinitionIdOrName": "Owner"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": "b24988ac-6180-42a0-ab88-20f7382dd24c"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": ""
}
]
},
@@ -210,13 +230,6 @@ module accessConnector 'br:bicep/modules/databricks.access-connector:1.0.0' = {
''
]
}
- roleAssignments: [
- {
- principalId: ''
- principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
- }
- ]
tags: {
Environment: 'Non-Prod'
'hidden-title': 'This is visible in the resource name'
@@ -263,15 +276,6 @@ module accessConnector 'br:bicep/modules/databricks.access-connector:1.0.0' = {
]
}
},
- "roleAssignments": {
- "value": [
- {
- "principalId": "",
- "principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
- }
- ]
- },
"tags": {
"value": {
"Environment": "Non-Prod",
@@ -303,7 +307,7 @@ module accessConnector 'br:bicep/modules/databricks.access-connector:1.0.0' = {
| [`location`](#parameter-location) | string | Location for all Resources. |
| [`lock`](#parameter-lock) | object | The lock settings of the service. |
| [`managedIdentities`](#parameter-managedidentities) | object | The managed identity definition for this resource. |
-| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
+| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignments to create. |
| [`tags`](#parameter-tags) | object | Tags of the resource. |
### Parameter: `enableDefaultTelemetry`
@@ -381,7 +385,7 @@ The name of the Azure Databricks access connector to create.
### Parameter: `roleAssignments`
-Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
+Array of role assignments to create.
- Required: No
- Type: array
@@ -394,7 +398,7 @@ Array of role assignment objects that contain the 'roleDefinitionIdOrName' and '
| [`description`](#parameter-roleassignmentsdescription) | No | string | Optional. The description of the role assignment. |
| [`principalId`](#parameter-roleassignmentsprincipalid) | Yes | string | Required. The principal ID of the principal (user/group/identity) to assign the role to. |
| [`principalType`](#parameter-roleassignmentsprincipaltype) | No | string | Optional. The principal type of the assigned principal ID. |
-| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead. |
+| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
### Parameter: `roleAssignments.condition`
@@ -442,7 +446,7 @@ Optional. The principal type of the assigned principal ID.
### Parameter: `roleAssignments.roleDefinitionIdOrName`
-Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.
+Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
- Required: Yes
- Type: string
diff --git a/modules/databricks/access-connector/main.bicep b/modules/databricks/access-connector/main.bicep
index 6a680d39ce..53ba92c2c2 100644
--- a/modules/databricks/access-connector/main.bicep
+++ b/modules/databricks/access-connector/main.bicep
@@ -11,7 +11,7 @@ param tags object?
@description('Optional. Location for all Resources.')
param location string = resourceGroup().location
-@description('Optional. Array of role assignment objects that contain the \'roleDefinitionIdOrName\' and \'principalId\' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
+@description('Optional. Array of role assignments to create.')
param roleAssignments roleAssignmentType
@description('Optional. The lock settings of the service.')
@@ -70,7 +70,7 @@ resource accessConnector_lock 'Microsoft.Authorization/locks@2020-05-01' = if (!
resource accessConnector_roleAssignments 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for (roleAssignment, index) in (roleAssignments ?? []): {
name: guid(accessConnector.id, roleAssignment.principalId, roleAssignment.roleDefinitionIdOrName)
properties: {
- roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : roleAssignment.roleDefinitionIdOrName
+ roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : contains(roleAssignment.roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/') ? roleAssignment.roleDefinitionIdOrName : subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleAssignment.roleDefinitionIdOrName)
principalId: roleAssignment.principalId
description: roleAssignment.?description
principalType: roleAssignment.?principalType
@@ -117,7 +117,7 @@ type lockType = {
}?
type roleAssignmentType = {
- @description('Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.')
+ @description('Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
roleDefinitionIdOrName: string
@description('Required. The principal ID of the principal (user/group/identity) to assign the role to.')
diff --git a/modules/databricks/access-connector/main.json b/modules/databricks/access-connector/main.json
index fbb23e6cc8..dce724ef4b 100644
--- a/modules/databricks/access-connector/main.json
+++ b/modules/databricks/access-connector/main.json
@@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
- "templateHash": "6639727250601518153"
+ "templateHash": "3245638906962144809"
},
"name": "Azure Databricks Access Connectors",
"description": "This module deploys an Azure Databricks Access Connector.",
@@ -69,7 +69,7 @@
"roleDefinitionIdOrName": {
"type": "string",
"metadata": {
- "description": "Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead."
+ "description": "Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
}
},
"principalId": {
@@ -152,7 +152,7 @@
"roleAssignments": {
"$ref": "#/definitions/roleAssignmentType",
"metadata": {
- "description": "Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
+ "description": "Optional. Array of role assignments to create."
}
},
"lock": {
@@ -234,7 +234,7 @@
"scope": "[format('Microsoft.Databricks/accessConnectors/{0}', parameters('name'))]",
"name": "[guid(resourceId('Microsoft.Databricks/accessConnectors', parameters('name')), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId, coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
"properties": {
- "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
+ "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], if(contains(coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)))]",
"principalId": "[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId]",
"description": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'description')]",
"principalType": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'principalType')]",
diff --git a/modules/databricks/access-connector/tests/e2e/max/main.test.bicep b/modules/databricks/access-connector/tests/e2e/max/main.test.bicep
index 268b24f056..586cd17f0c 100644
--- a/modules/databricks/access-connector/tests/e2e/max/main.test.bicep
+++ b/modules/databricks/access-connector/tests/e2e/max/main.test.bicep
@@ -65,7 +65,17 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
}
roleAssignments: [
{
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')
principalId: nestedDependencies.outputs.managedIdentityPrincipalId
principalType: 'ServicePrincipal'
}
diff --git a/modules/databricks/access-connector/tests/e2e/waf-aligned/main.test.bicep b/modules/databricks/access-connector/tests/e2e/waf-aligned/main.test.bicep
index bf7405d2c9..64b4f1b6ab 100644
--- a/modules/databricks/access-connector/tests/e2e/waf-aligned/main.test.bicep
+++ b/modules/databricks/access-connector/tests/e2e/waf-aligned/main.test.bicep
@@ -63,13 +63,6 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
nestedDependencies.outputs.managedIdentityResourceId
]
}
- roleAssignments: [
- {
- roleDefinitionIdOrName: 'Reader'
- principalId: nestedDependencies.outputs.managedIdentityPrincipalId
- principalType: 'ServicePrincipal'
- }
- ]
tags: {
'hidden-title': 'This is visible in the resource name'
Environment: 'Non-Prod'
diff --git a/modules/databricks/workspace/README.md b/modules/databricks/workspace/README.md
index fcb2e26a86..a41556f10d 100644
--- a/modules/databricks/workspace/README.md
+++ b/modules/databricks/workspace/README.md
@@ -160,7 +160,17 @@ module workspace 'br:bicep/modules/databricks.workspace:1.0.0' = {
{
principalId: ''
principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: ''
}
]
skuName: 'premium'
@@ -298,7 +308,17 @@ module workspace 'br:bicep/modules/databricks.workspace:1.0.0' = {
{
"principalId": "",
"principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
+ "roleDefinitionIdOrName": "Owner"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": "b24988ac-6180-42a0-ab88-20f7382dd24c"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": ""
}
]
},
@@ -402,13 +422,6 @@ module workspace 'br:bicep/modules/databricks.workspace:1.0.0' = {
publicNetworkAccess: 'Disabled'
requiredNsgRules: 'NoAzureDatabricksRules'
requireInfrastructureEncryption: true
- roleAssignments: [
- {
- principalId: ''
- principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
- }
- ]
skuName: 'premium'
storageAccountName: 'sadwwaf001'
storageAccountSkuName: 'Standard_ZRS'
@@ -539,15 +552,6 @@ module workspace 'br:bicep/modules/databricks.workspace:1.0.0' = {
"requireInfrastructureEncryption": {
"value": true
},
- "roleAssignments": {
- "value": [
- {
- "principalId": "",
- "principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
- }
- ]
- },
"skuName": {
"value": "premium"
},
@@ -608,7 +612,7 @@ module workspace 'br:bicep/modules/databricks.workspace:1.0.0' = {
| [`publicNetworkAccess`](#parameter-publicnetworkaccess) | string | The network access type for accessing workspace. Set value to disabled to access workspace only via private link. |
| [`requiredNsgRules`](#parameter-requirednsgrules) | string | Gets or sets a value indicating whether data plane (clusters) to control plane communication happen over private endpoint. |
| [`requireInfrastructureEncryption`](#parameter-requireinfrastructureencryption) | bool | A boolean indicating whether or not the DBFS root file system will be enabled with secondary layer of encryption with platform managed keys for data at rest. |
-| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
+| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignments to create. |
| [`skuName`](#parameter-skuname) | string | The pricing tier of workspace. |
| [`storageAccountName`](#parameter-storageaccountname) | string | Default DBFS storage account name. |
| [`storageAccountSkuName`](#parameter-storageaccountskuname) | string | Storage account SKU name. |
@@ -939,7 +943,7 @@ Configuration details for private endpoints. For security reasons, it is recomme
| [`name`](#parameter-privateendpointsname) | No | string | Optional. The name of the private endpoint. |
| [`privateDnsZoneGroupName`](#parameter-privateendpointsprivatednszonegroupname) | No | string | Optional. The name of the private DNS zone group to create if privateDnsZoneResourceIds were provided. |
| [`privateDnsZoneResourceIds`](#parameter-privateendpointsprivatednszoneresourceids) | No | array | Optional. The private DNS zone groups to associate the private endpoint with. A DNS zone group can support up to 5 DNS zones. |
-| [`roleAssignments`](#parameter-privateendpointsroleassignments) | No | array | Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
+| [`roleAssignments`](#parameter-privateendpointsroleassignments) | No | array | Optional. Array of role assignments to create. |
| [`service`](#parameter-privateendpointsservice) | No | string | Optional. The service (sub-) type to deploy the private endpoint for. For example "vault" or "blob". |
| [`subnetResourceId`](#parameter-privateendpointssubnetresourceid) | Yes | string | Required. Resource ID of the subnet where the endpoint needs to be created. |
| [`tags`](#parameter-privateendpointstags) | No | object | Optional. Tags to be applied on all resources/resource groups in this deployment. |
@@ -1091,7 +1095,7 @@ Optional. The private DNS zone groups to associate the private endpoint with. A
### Parameter: `privateEndpoints.roleAssignments`
-Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
+Optional. Array of role assignments to create.
- Required: No
- Type: array
@@ -1161,7 +1165,7 @@ A boolean indicating whether or not the DBFS root file system will be enabled wi
### Parameter: `roleAssignments`
-Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
+Array of role assignments to create.
- Required: No
- Type: array
@@ -1174,7 +1178,7 @@ Array of role assignment objects that contain the 'roleDefinitionIdOrName' and '
| [`description`](#parameter-roleassignmentsdescription) | No | string | Optional. The description of the role assignment. |
| [`principalId`](#parameter-roleassignmentsprincipalid) | Yes | string | Required. The principal ID of the principal (user/group/identity) to assign the role to. |
| [`principalType`](#parameter-roleassignmentsprincipaltype) | No | string | Optional. The principal type of the assigned principal ID. |
-| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead. |
+| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
### Parameter: `roleAssignments.condition`
@@ -1222,7 +1226,7 @@ Optional. The principal type of the assigned principal ID.
### Parameter: `roleAssignments.roleDefinitionIdOrName`
-Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.
+Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
- Required: Yes
- Type: string
diff --git a/modules/databricks/workspace/main.bicep b/modules/databricks/workspace/main.bicep
index 524ab6c616..0d7e6cdb19 100644
--- a/modules/databricks/workspace/main.bicep
+++ b/modules/databricks/workspace/main.bicep
@@ -19,7 +19,7 @@ param skuName string = 'premium'
@description('Optional. Location for all Resources.')
param location string = resourceGroup().location
-@description('Optional. Array of role assignment objects that contain the \'roleDefinitionIdOrName\' and \'principalId\' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
+@description('Optional. Array of role assignments to create.')
param roleAssignments roleAssignmentType
@description('Optional. The diagnostic settings of the service.')
@@ -273,7 +273,7 @@ resource workspace_diagnosticSettings 'Microsoft.Insights/diagnosticSettings@202
resource workspace_roleAssignments 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for (roleAssignment, index) in (roleAssignments ?? []): {
name: guid(workspace.id, roleAssignment.principalId, roleAssignment.roleDefinitionIdOrName)
properties: {
- roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : roleAssignment.roleDefinitionIdOrName
+ roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : contains(roleAssignment.roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/') ? roleAssignment.roleDefinitionIdOrName : subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleAssignment.roleDefinitionIdOrName)
principalId: roleAssignment.principalId
description: roleAssignment.?description
principalType: roleAssignment.?principalType
@@ -333,7 +333,7 @@ type lockType = {
}?
type roleAssignmentType = {
- @description('Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.')
+ @description('Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
roleDefinitionIdOrName: string
@description('Required. The principal ID of the principal (user/group/identity) to assign the role to.')
@@ -410,7 +410,7 @@ type privateEndpointType = {
@description('Optional. Specify the type of lock.')
lock: lockType
- @description('Optional. Array of role assignment objects that contain the \'roleDefinitionIdOrName\' and \'principalId\' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
+ @description('Optional. Array of role assignments to create.')
roleAssignments: roleAssignmentType
@description('Optional. Tags to be applied on all resources/resource groups in this deployment.')
diff --git a/modules/databricks/workspace/main.json b/modules/databricks/workspace/main.json
index 390fcb0f0c..47a19aa465 100644
--- a/modules/databricks/workspace/main.json
+++ b/modules/databricks/workspace/main.json
@@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
- "templateHash": "450554632364437388"
+ "templateHash": "17678709403904494263"
},
"name": "Azure Databricks Workspaces",
"description": "This module deploys an Azure Databricks Workspace.",
@@ -46,7 +46,7 @@
"roleDefinitionIdOrName": {
"type": "string",
"metadata": {
- "description": "Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead."
+ "description": "Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
}
},
"principalId": {
@@ -251,7 +251,7 @@
"roleAssignments": {
"$ref": "#/definitions/roleAssignmentType",
"metadata": {
- "description": "Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
+ "description": "Optional. Array of role assignments to create."
}
},
"tags": {
@@ -475,7 +475,7 @@
"roleAssignments": {
"$ref": "#/definitions/roleAssignmentType",
"metadata": {
- "description": "Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
+ "description": "Optional. Array of role assignments to create."
}
},
"diagnosticSettings": {
@@ -777,7 +777,7 @@
"scope": "[format('Microsoft.Databricks/workspaces/{0}', parameters('name'))]",
"name": "[guid(resourceId('Microsoft.Databricks/workspaces', parameters('name')), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId, coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
"properties": {
- "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
+ "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], if(contains(coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)))]",
"principalId": "[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId]",
"description": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'description')]",
"principalType": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'principalType')]",
diff --git a/modules/databricks/workspace/tests/e2e/max/main.test.bicep b/modules/databricks/workspace/tests/e2e/max/main.test.bicep
index 00f1d84997..5656e772da 100644
--- a/modules/databricks/workspace/tests/e2e/max/main.test.bicep
+++ b/modules/databricks/workspace/tests/e2e/max/main.test.bicep
@@ -103,7 +103,17 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
}
roleAssignments: [
{
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')
principalId: nestedDependencies.outputs.managedIdentityPrincipalId
principalType: 'ServicePrincipal'
}
diff --git a/modules/databricks/workspace/tests/e2e/waf-aligned/main.test.bicep b/modules/databricks/workspace/tests/e2e/waf-aligned/main.test.bicep
index 537323ad34..66928e1121 100644
--- a/modules/databricks/workspace/tests/e2e/waf-aligned/main.test.bicep
+++ b/modules/databricks/workspace/tests/e2e/waf-aligned/main.test.bicep
@@ -101,13 +101,6 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
kind: 'CanNotDelete'
name: 'myCustomLockName'
}
- roleAssignments: [
- {
- roleDefinitionIdOrName: 'Reader'
- principalId: nestedDependencies.outputs.managedIdentityPrincipalId
- principalType: 'ServicePrincipal'
- }
- ]
tags: {
'hidden-title': 'This is visible in the resource name'
Environment: 'Non-Prod'
diff --git a/modules/db-for-my-sql/flexible-server/README.md b/modules/db-for-my-sql/flexible-server/README.md
index e23b4de351..4d655aab35 100644
--- a/modules/db-for-my-sql/flexible-server/README.md
+++ b/modules/db-for-my-sql/flexible-server/README.md
@@ -160,7 +160,17 @@ module flexibleServer 'br:bicep/modules/db-for-my-sql.flexible-server:1.0.0' = {
{
principalId: ''
principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: ''
}
]
storageAutoGrow: 'Enabled'
@@ -273,7 +283,17 @@ module flexibleServer 'br:bicep/modules/db-for-my-sql.flexible-server:1.0.0' = {
{
"principalId": "",
"principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
+ "roleDefinitionIdOrName": "Owner"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": "b24988ac-6180-42a0-ab88-20f7382dd24c"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": ""
}
]
},
@@ -1044,7 +1064,7 @@ Array of role assignment objects that contain the "roleDefinitionIdOrName" and "
| [`description`](#parameter-roleassignmentsdescription) | No | string | Optional. The description of the role assignment. |
| [`principalId`](#parameter-roleassignmentsprincipalid) | Yes | string | Required. The principal ID of the principal (user/group/identity) to assign the role to. |
| [`principalType`](#parameter-roleassignmentsprincipaltype) | No | string | Optional. The principal type of the assigned principal ID. |
-| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead. |
+| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
### Parameter: `roleAssignments.condition`
@@ -1092,7 +1112,7 @@ Optional. The principal type of the assigned principal ID.
### Parameter: `roleAssignments.roleDefinitionIdOrName`
-Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.
+Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
- Required: Yes
- Type: string
diff --git a/modules/db-for-my-sql/flexible-server/main.bicep b/modules/db-for-my-sql/flexible-server/main.bicep
index dc99f1c7e9..d89c29094a 100644
--- a/modules/db-for-my-sql/flexible-server/main.bicep
+++ b/modules/db-for-my-sql/flexible-server/main.bicep
@@ -284,7 +284,7 @@ resource flexibleServer_lock 'Microsoft.Authorization/locks@2020-05-01' = if (!e
resource flexibleServer_roleAssignments 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for (roleAssignment, index) in (roleAssignments ?? []): {
name: guid(flexibleServer.id, roleAssignment.principalId, roleAssignment.roleDefinitionIdOrName)
properties: {
- roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : roleAssignment.roleDefinitionIdOrName
+ roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : contains(roleAssignment.roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/') ? roleAssignment.roleDefinitionIdOrName : subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleAssignment.roleDefinitionIdOrName)
principalId: roleAssignment.principalId
description: roleAssignment.?description
principalType: roleAssignment.?principalType
@@ -384,7 +384,7 @@ type lockType = {
}?
type roleAssignmentType = {
- @description('Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.')
+ @description('Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
roleDefinitionIdOrName: string
@description('Required. The principal ID of the principal (user/group/identity) to assign the role to.')
diff --git a/modules/db-for-my-sql/flexible-server/main.json b/modules/db-for-my-sql/flexible-server/main.json
index a4ccada7bc..5d63ee48ca 100644
--- a/modules/db-for-my-sql/flexible-server/main.json
+++ b/modules/db-for-my-sql/flexible-server/main.json
@@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
- "templateHash": "4826973555855760872"
+ "templateHash": "13509958318011769977"
},
"name": "DBforMySQL Flexible Servers",
"description": "This module deploys a DBforMySQL Flexible Server.",
@@ -61,7 +61,7 @@
"roleDefinitionIdOrName": {
"type": "string",
"metadata": {
- "description": "Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead."
+ "description": "Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
}
},
"principalId": {
@@ -698,7 +698,7 @@
"scope": "[format('Microsoft.DBforMySQL/flexibleServers/{0}', parameters('name'))]",
"name": "[guid(resourceId('Microsoft.DBforMySQL/flexibleServers', parameters('name')), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId, coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
"properties": {
- "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
+ "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], if(contains(coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)))]",
"principalId": "[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId]",
"description": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'description')]",
"principalType": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'principalType')]",
diff --git a/modules/db-for-my-sql/flexible-server/tests/e2e/private/main.test.bicep b/modules/db-for-my-sql/flexible-server/tests/e2e/private/main.test.bicep
index e5203d967c..46a67b9445 100644
--- a/modules/db-for-my-sql/flexible-server/tests/e2e/private/main.test.bicep
+++ b/modules/db-for-my-sql/flexible-server/tests/e2e/private/main.test.bicep
@@ -76,7 +76,17 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
}
roleAssignments: [
{
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')
principalId: nestedDependencies.outputs.managedIdentityPrincipalId
principalType: 'ServicePrincipal'
}
diff --git a/modules/db-for-postgre-sql/flexible-server/README.md b/modules/db-for-postgre-sql/flexible-server/README.md
index bfa29ed68f..30ebf9dba0 100644
--- a/modules/db-for-postgre-sql/flexible-server/README.md
+++ b/modules/db-for-postgre-sql/flexible-server/README.md
@@ -543,7 +543,7 @@ module flexibleServer 'br:bicep/modules/db-for-postgre-sql.flexible-server:1.0.0
| [`maintenanceWindow`](#parameter-maintenancewindow) | object | Properties for the maintenence window. If provided, "customWindow" property must exist and set to "Enabled". |
| [`passwordAuth`](#parameter-passwordauth) | string | If Enabled, password authentication is enabled. |
| [`privateDnsZoneArmResourceId`](#parameter-privatednszonearmresourceid) | string | Private dns zone arm resource ID. Used when the desired connectivity mode is "Private Access" and required when "delegatedSubnetResourceId" is used. The Private DNS Zone must be lined to the Virtual Network referenced in "delegatedSubnetResourceId". |
-| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
+| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignments to create. |
| [`storageSizeGB`](#parameter-storagesizegb) | int | Max storage allowed for a server. |
| [`tags`](#parameter-tags) | object | Tags of the resource. |
| [`tenantId`](#parameter-tenantid) | string | Tenant id of the server. |
@@ -939,7 +939,7 @@ Private dns zone arm resource ID. Used when the desired connectivity mode is "Pr
### Parameter: `roleAssignments`
-Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
+Array of role assignments to create.
- Required: No
- Type: array
@@ -952,7 +952,7 @@ Array of role assignment objects that contain the 'roleDefinitionIdOrName' and '
| [`description`](#parameter-roleassignmentsdescription) | No | string | Optional. The description of the role assignment. |
| [`principalId`](#parameter-roleassignmentsprincipalid) | Yes | string | Required. The principal ID of the principal (user/group/identity) to assign the role to. |
| [`principalType`](#parameter-roleassignmentsprincipaltype) | No | string | Optional. The principal type of the assigned principal ID. |
-| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead. |
+| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
### Parameter: `roleAssignments.condition`
@@ -1000,7 +1000,7 @@ Optional. The principal type of the assigned principal ID.
### Parameter: `roleAssignments.roleDefinitionIdOrName`
-Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.
+Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
- Required: Yes
- Type: string
diff --git a/modules/db-for-postgre-sql/flexible-server/main.bicep b/modules/db-for-postgre-sql/flexible-server/main.bicep
index e1731b412a..c6d1b75d5c 100644
--- a/modules/db-for-postgre-sql/flexible-server/main.bicep
+++ b/modules/db-for-postgre-sql/flexible-server/main.bicep
@@ -143,7 +143,7 @@ param configurations array = []
@description('Optional. The lock settings of the service.')
param lock lockType
-@description('Optional. Array of role assignment objects that contain the \'roleDefinitionIdOrName\' and \'principalId\' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
+@description('Optional. Array of role assignments to create.')
param roleAssignments roleAssignmentType
@description('Optional. Tags of the resource.')
@@ -261,7 +261,7 @@ resource flexibleServer_lock 'Microsoft.Authorization/locks@2020-05-01' = if (!e
resource flexibleServer_roleAssignments 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for (roleAssignment, index) in (roleAssignments ?? []): {
name: guid(flexibleServer.id, roleAssignment.principalId, roleAssignment.roleDefinitionIdOrName)
properties: {
- roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : roleAssignment.roleDefinitionIdOrName
+ roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : contains(roleAssignment.roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/') ? roleAssignment.roleDefinitionIdOrName : subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleAssignment.roleDefinitionIdOrName)
principalId: roleAssignment.principalId
description: roleAssignment.?description
principalType: roleAssignment.?principalType
@@ -379,7 +379,7 @@ type lockType = {
}?
type roleAssignmentType = {
- @description('Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.')
+ @description('Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
roleDefinitionIdOrName: string
@description('Required. The principal ID of the principal (user/group/identity) to assign the role to.')
diff --git a/modules/db-for-postgre-sql/flexible-server/main.json b/modules/db-for-postgre-sql/flexible-server/main.json
index 6a905a8e17..25dcb199a2 100644
--- a/modules/db-for-postgre-sql/flexible-server/main.json
+++ b/modules/db-for-postgre-sql/flexible-server/main.json
@@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
- "templateHash": "13706520211272319877"
+ "templateHash": "10058986332950368920"
},
"name": "DBforPostgreSQL Flexible Servers",
"description": "This module deploys a DBforPostgreSQL Flexible Server.",
@@ -61,7 +61,7 @@
"roleDefinitionIdOrName": {
"type": "string",
"metadata": {
- "description": "Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead."
+ "description": "Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
}
},
"principalId": {
@@ -506,7 +506,7 @@
"roleAssignments": {
"$ref": "#/definitions/roleAssignmentType",
"metadata": {
- "description": "Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
+ "description": "Optional. Array of role assignments to create."
}
},
"tags": {
@@ -655,7 +655,7 @@
"scope": "[format('Microsoft.DBforPostgreSQL/flexibleServers/{0}', parameters('name'))]",
"name": "[guid(resourceId('Microsoft.DBforPostgreSQL/flexibleServers', parameters('name')), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId, coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
"properties": {
- "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
+ "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], if(contains(coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)))]",
"principalId": "[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId]",
"description": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'description')]",
"principalType": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'principalType')]",
diff --git a/modules/desktop-virtualization/application-group/README.md b/modules/desktop-virtualization/application-group/README.md
index 22947a3ef1..0c3b211b08 100644
--- a/modules/desktop-virtualization/application-group/README.md
+++ b/modules/desktop-virtualization/application-group/README.md
@@ -145,7 +145,17 @@ module applicationGroup 'br:bicep/modules/desktop-virtualization.application-gro
{
principalId: ''
principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: ''
}
]
tags: {
@@ -234,7 +244,17 @@ module applicationGroup 'br:bicep/modules/desktop-virtualization.application-gro
{
"principalId": "",
"principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
+ "roleDefinitionIdOrName": "Owner"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": "b24988ac-6180-42a0-ab88-20f7382dd24c"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": ""
}
]
},
@@ -305,13 +325,6 @@ module applicationGroup 'br:bicep/modules/desktop-virtualization.application-gro
kind: 'CanNotDelete'
name: 'myCustomLockName'
}
- roleAssignments: [
- {
- principalId: ''
- principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
- }
- ]
tags: {
Environment: 'Non-Prod'
'hidden-title': 'This is visible in the resource name'
@@ -393,15 +406,6 @@ module applicationGroup 'br:bicep/modules/desktop-virtualization.application-gro
"name": "myCustomLockName"
}
},
- "roleAssignments": {
- "value": [
- {
- "principalId": "",
- "principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
- }
- ]
- },
"tags": {
"value": {
"Environment": "Non-Prod",
diff --git a/modules/desktop-virtualization/application-group/main.bicep b/modules/desktop-virtualization/application-group/main.bicep
index 390e74da2f..55bd2d0ee3 100644
--- a/modules/desktop-virtualization/application-group/main.bicep
+++ b/modules/desktop-virtualization/application-group/main.bicep
@@ -143,7 +143,7 @@ module appGroup_applications 'application/main.bicep' = [for (application, index
resource appGroup_roleAssignments 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for (roleAssignment, index) in (roleAssignments ?? []): {
name: guid(appGroup.id, roleAssignment.principalId, roleAssignment.roleDefinitionIdOrName)
properties: {
- roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : roleAssignment.roleDefinitionIdOrName
+ roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : contains(roleAssignment.roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/') ? roleAssignment.roleDefinitionIdOrName : subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleAssignment.roleDefinitionIdOrName)
principalId: roleAssignment.principalId
description: roleAssignment.?description
principalType: roleAssignment.?principalType
diff --git a/modules/desktop-virtualization/application-group/main.json b/modules/desktop-virtualization/application-group/main.json
index 50f7154d0c..f94e06adf4 100644
--- a/modules/desktop-virtualization/application-group/main.json
+++ b/modules/desktop-virtualization/application-group/main.json
@@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
- "templateHash": "10392643216669479103"
+ "templateHash": "1467950374107623921"
},
"name": "Azure Virtual Desktop (AVD) Application Groups",
"description": "This module deploys an Azure Virtual Desktop (AVD) Application Group.",
@@ -385,7 +385,7 @@
"scope": "[format('Microsoft.DesktopVirtualization/applicationGroups/{0}', parameters('name'))]",
"name": "[guid(resourceId('Microsoft.DesktopVirtualization/applicationGroups', parameters('name')), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId, coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
"properties": {
- "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
+ "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], if(contains(coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)))]",
"principalId": "[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId]",
"description": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'description')]",
"principalType": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'principalType')]",
diff --git a/modules/desktop-virtualization/application-group/tests/e2e/max/main.test.bicep b/modules/desktop-virtualization/application-group/tests/e2e/max/main.test.bicep
index 49d1fc5088..3529748317 100644
--- a/modules/desktop-virtualization/application-group/tests/e2e/max/main.test.bicep
+++ b/modules/desktop-virtualization/application-group/tests/e2e/max/main.test.bicep
@@ -106,7 +106,17 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
}
roleAssignments: [
{
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')
principalId: nestedDependencies.outputs.managedIdentityPrincipalId
principalType: 'ServicePrincipal'
}
diff --git a/modules/desktop-virtualization/application-group/tests/e2e/waf-aligned/main.test.bicep b/modules/desktop-virtualization/application-group/tests/e2e/waf-aligned/main.test.bicep
index a5bb068c02..8bfb658ff8 100644
--- a/modules/desktop-virtualization/application-group/tests/e2e/waf-aligned/main.test.bicep
+++ b/modules/desktop-virtualization/application-group/tests/e2e/waf-aligned/main.test.bicep
@@ -104,13 +104,6 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
kind: 'CanNotDelete'
name: 'myCustomLockName'
}
- roleAssignments: [
- {
- roleDefinitionIdOrName: 'Reader'
- principalId: nestedDependencies.outputs.managedIdentityPrincipalId
- principalType: 'ServicePrincipal'
- }
- ]
tags: {
'hidden-title': 'This is visible in the resource name'
Environment: 'Non-Prod'
diff --git a/modules/desktop-virtualization/host-pool/README.md b/modules/desktop-virtualization/host-pool/README.md
index 37af321393..5e3c70c4fb 100644
--- a/modules/desktop-virtualization/host-pool/README.md
+++ b/modules/desktop-virtualization/host-pool/README.md
@@ -135,7 +135,17 @@ module hostPool 'br:bicep/modules/desktop-virtualization.host-pool:1.0.0' = {
{
principalId: ''
principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: ''
}
]
tags: {
@@ -245,7 +255,17 @@ module hostPool 'br:bicep/modules/desktop-virtualization.host-pool:1.0.0' = {
{
"principalId": "",
"principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
+ "roleDefinitionIdOrName": "Owner"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": "b24988ac-6180-42a0-ab88-20f7382dd24c"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": ""
}
]
},
@@ -337,13 +357,6 @@ module hostPool 'br:bicep/modules/desktop-virtualization.host-pool:1.0.0' = {
}
maxSessionLimit: 99999
personalDesktopAssignmentType: 'Automatic'
- roleAssignments: [
- {
- principalId: ''
- principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
- }
- ]
tags: {
Environment: 'Non-Prod'
'hidden-title': 'This is visible in the resource name'
@@ -446,15 +459,6 @@ module hostPool 'br:bicep/modules/desktop-virtualization.host-pool:1.0.0' = {
"personalDesktopAssignmentType": {
"value": "Automatic"
},
- "roleAssignments": {
- "value": [
- {
- "principalId": "",
- "principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
- }
- ]
- },
"tags": {
"value": {
"Environment": "Non-Prod",
diff --git a/modules/desktop-virtualization/host-pool/main.bicep b/modules/desktop-virtualization/host-pool/main.bicep
index 228901fa8d..1af44b1e15 100644
--- a/modules/desktop-virtualization/host-pool/main.bicep
+++ b/modules/desktop-virtualization/host-pool/main.bicep
@@ -249,7 +249,7 @@ resource hostPool_diagnosticSettings 'Microsoft.Insights/diagnosticSettings@2021
resource hostPool_roleAssignments 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for (roleAssignment, index) in (roleAssignments ?? []): {
name: guid(hostPool.id, roleAssignment.principalId, roleAssignment.roleDefinitionIdOrName)
properties: {
- roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : roleAssignment.roleDefinitionIdOrName
+ roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : contains(roleAssignment.roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/') ? roleAssignment.roleDefinitionIdOrName : subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleAssignment.roleDefinitionIdOrName)
principalId: roleAssignment.principalId
description: roleAssignment.?description
principalType: roleAssignment.?principalType
diff --git a/modules/desktop-virtualization/host-pool/main.json b/modules/desktop-virtualization/host-pool/main.json
index 9d02aba679..3e319b32f0 100644
--- a/modules/desktop-virtualization/host-pool/main.json
+++ b/modules/desktop-virtualization/host-pool/main.json
@@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
- "templateHash": "14800561756618420199"
+ "templateHash": "14589445999747413105"
},
"name": "Azure Virtual Desktop (AVD) Host Pools",
"description": "This module deploys an Azure Virtual Desktop (AVD) Host Pool.",
@@ -583,7 +583,7 @@
"scope": "[format('Microsoft.DesktopVirtualization/hostPools/{0}', parameters('name'))]",
"name": "[guid(resourceId('Microsoft.DesktopVirtualization/hostPools', parameters('name')), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId, coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
"properties": {
- "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
+ "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], if(contains(coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)))]",
"principalId": "[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId]",
"description": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'description')]",
"principalType": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'principalType')]",
diff --git a/modules/desktop-virtualization/host-pool/tests/e2e/max/main.test.bicep b/modules/desktop-virtualization/host-pool/tests/e2e/max/main.test.bicep
index b014dcfb07..07996d49e3 100644
--- a/modules/desktop-virtualization/host-pool/tests/e2e/max/main.test.bicep
+++ b/modules/desktop-virtualization/host-pool/tests/e2e/max/main.test.bicep
@@ -90,7 +90,17 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
personalDesktopAssignmentType: 'Automatic'
roleAssignments: [
{
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')
principalId: nestedDependencies.outputs.managedIdentityPrincipalId
principalType: 'ServicePrincipal'
}
diff --git a/modules/desktop-virtualization/host-pool/tests/e2e/waf-aligned/main.test.bicep b/modules/desktop-virtualization/host-pool/tests/e2e/waf-aligned/main.test.bicep
index eb8918d929..05123d5d47 100644
--- a/modules/desktop-virtualization/host-pool/tests/e2e/waf-aligned/main.test.bicep
+++ b/modules/desktop-virtualization/host-pool/tests/e2e/waf-aligned/main.test.bicep
@@ -88,13 +88,6 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
}
maxSessionLimit: 99999
personalDesktopAssignmentType: 'Automatic'
- roleAssignments: [
- {
- roleDefinitionIdOrName: 'Reader'
- principalId: nestedDependencies.outputs.managedIdentityPrincipalId
- principalType: 'ServicePrincipal'
- }
- ]
vmTemplate: {
customImageId: null
domain: 'domainname.onmicrosoft.com'
diff --git a/modules/desktop-virtualization/scaling-plan/README.md b/modules/desktop-virtualization/scaling-plan/README.md
index 96f2d667e4..6511a66cc7 100644
--- a/modules/desktop-virtualization/scaling-plan/README.md
+++ b/modules/desktop-virtualization/scaling-plan/README.md
@@ -111,7 +111,17 @@ module scalingPlan 'br:bicep/modules/desktop-virtualization.scaling-plan:1.0.0'
{
principalId: ''
principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: ''
}
]
schedules: [
@@ -208,7 +218,17 @@ module scalingPlan 'br:bicep/modules/desktop-virtualization.scaling-plan:1.0.0'
{
"principalId": "",
"principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
+ "roleDefinitionIdOrName": "Owner"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": "b24988ac-6180-42a0-ab88-20f7382dd24c"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": ""
}
]
},
@@ -297,13 +317,6 @@ module scalingPlan 'br:bicep/modules/desktop-virtualization.scaling-plan:1.0.0'
enableDefaultTelemetry: ''
friendlyName: 'My Scaling Plan'
hostPoolType: 'Pooled'
- roleAssignments: [
- {
- principalId: ''
- principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
- }
- ]
schedules: [
{
daysOfWeek: [
@@ -393,15 +406,6 @@ module scalingPlan 'br:bicep/modules/desktop-virtualization.scaling-plan:1.0.0'
"hostPoolType": {
"value": "Pooled"
},
- "roleAssignments": {
- "value": [
- {
- "principalId": "",
- "principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
- }
- ]
- },
"schedules": {
"value": [
{
diff --git a/modules/desktop-virtualization/scaling-plan/main.bicep b/modules/desktop-virtualization/scaling-plan/main.bicep
index 1f9734fb0a..69551d44a8 100644
--- a/modules/desktop-virtualization/scaling-plan/main.bicep
+++ b/modules/desktop-virtualization/scaling-plan/main.bicep
@@ -155,7 +155,7 @@ resource scalingPlan_diagnosticSettings 'Microsoft.Insights/diagnosticSettings@2
resource scalingplan_roleAssignments 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for (roleAssignment, index) in (roleAssignments ?? []): {
name: guid(scalingPlan.id, roleAssignment.principalId, roleAssignment.roleDefinitionIdOrName)
properties: {
- roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : roleAssignment.roleDefinitionIdOrName
+ roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : contains(roleAssignment.roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/') ? roleAssignment.roleDefinitionIdOrName : subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleAssignment.roleDefinitionIdOrName)
principalId: roleAssignment.principalId
description: roleAssignment.?description
principalType: roleAssignment.?principalType
diff --git a/modules/desktop-virtualization/scaling-plan/main.json b/modules/desktop-virtualization/scaling-plan/main.json
index aee281bcd0..8a5a0b2063 100644
--- a/modules/desktop-virtualization/scaling-plan/main.json
+++ b/modules/desktop-virtualization/scaling-plan/main.json
@@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
- "templateHash": "16044277949435808798"
+ "templateHash": "16049673590929985376"
},
"name": "Azure Virtual Desktop (AVD) Scaling Plans",
"description": "This module deploys an Azure Virtual Desktop (AVD) Scaling Plan.",
@@ -387,7 +387,7 @@
"scope": "[format('Microsoft.DesktopVirtualization/scalingPlans/{0}', parameters('name'))]",
"name": "[guid(resourceId('Microsoft.DesktopVirtualization/scalingPlans', parameters('name')), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId, coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
"properties": {
- "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
+ "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], if(contains(coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)))]",
"principalId": "[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId]",
"description": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'description')]",
"principalType": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'principalType')]",
diff --git a/modules/desktop-virtualization/scaling-plan/tests/e2e/max/main.test.bicep b/modules/desktop-virtualization/scaling-plan/tests/e2e/max/main.test.bicep
index 9f93f1cae3..73f13bcc7f 100644
--- a/modules/desktop-virtualization/scaling-plan/tests/e2e/max/main.test.bicep
+++ b/modules/desktop-virtualization/scaling-plan/tests/e2e/max/main.test.bicep
@@ -69,7 +69,17 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
name: '${namePrefix}${serviceShort}001'
roleAssignments: [
{
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')
principalId: nestedDependencies.outputs.managedIdentityPrincipalId
principalType: 'ServicePrincipal'
}
diff --git a/modules/desktop-virtualization/scaling-plan/tests/e2e/waf-aligned/main.test.bicep b/modules/desktop-virtualization/scaling-plan/tests/e2e/waf-aligned/main.test.bicep
index 4e2ea6cc47..5eedc422fe 100644
--- a/modules/desktop-virtualization/scaling-plan/tests/e2e/waf-aligned/main.test.bicep
+++ b/modules/desktop-virtualization/scaling-plan/tests/e2e/waf-aligned/main.test.bicep
@@ -67,13 +67,6 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
params: {
enableDefaultTelemetry: enableDefaultTelemetry
name: '${namePrefix}${serviceShort}001'
- roleAssignments: [
- {
- roleDefinitionIdOrName: 'Reader'
- principalId: nestedDependencies.outputs.managedIdentityPrincipalId
- principalType: 'ServicePrincipal'
- }
- ]
diagnosticSettings: [
{
name: 'customSetting'
diff --git a/modules/desktop-virtualization/workspace/README.md b/modules/desktop-virtualization/workspace/README.md
index 641cdb7674..f363e71c1c 100644
--- a/modules/desktop-virtualization/workspace/README.md
+++ b/modules/desktop-virtualization/workspace/README.md
@@ -119,7 +119,17 @@ module workspace 'br:bicep/modules/desktop-virtualization.workspace:1.0.0' = {
{
principalId: ''
principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: ''
}
]
tags: {
@@ -187,7 +197,17 @@ module workspace 'br:bicep/modules/desktop-virtualization.workspace:1.0.0' = {
{
"principalId": "",
"principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
+ "roleDefinitionIdOrName": "Owner"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": "b24988ac-6180-42a0-ab88-20f7382dd24c"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": ""
}
]
},
@@ -241,13 +261,6 @@ module workspace 'br:bicep/modules/desktop-virtualization.workspace:1.0.0' = {
kind: 'CanNotDelete'
name: 'myCustomLockName'
}
- roleAssignments: [
- {
- principalId: ''
- principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
- }
- ]
tags: {
Environment: 'Non-Prod'
'hidden-title': 'This is visible in the resource name'
@@ -308,15 +321,6 @@ module workspace 'br:bicep/modules/desktop-virtualization.workspace:1.0.0' = {
"name": "myCustomLockName"
}
},
- "roleAssignments": {
- "value": [
- {
- "principalId": "",
- "principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
- }
- ]
- },
"tags": {
"value": {
"Environment": "Non-Prod",
diff --git a/modules/desktop-virtualization/workspace/main.bicep b/modules/desktop-virtualization/workspace/main.bicep
index 36963fc0af..418a5c72d4 100644
--- a/modules/desktop-virtualization/workspace/main.bicep
+++ b/modules/desktop-virtualization/workspace/main.bicep
@@ -108,7 +108,7 @@ resource workspace_diagnosticSettings 'Microsoft.Insights/diagnosticSettings@202
resource workspace_roleAssignments 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for (roleAssignment, index) in (roleAssignments ?? []): {
name: guid(workspace.id, roleAssignment.principalId, roleAssignment.roleDefinitionIdOrName)
properties: {
- roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : roleAssignment.roleDefinitionIdOrName
+ roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : contains(roleAssignment.roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/') ? roleAssignment.roleDefinitionIdOrName : subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleAssignment.roleDefinitionIdOrName)
principalId: roleAssignment.principalId
description: roleAssignment.?description
principalType: roleAssignment.?principalType
diff --git a/modules/desktop-virtualization/workspace/main.json b/modules/desktop-virtualization/workspace/main.json
index 3f354c8932..dab0738414 100644
--- a/modules/desktop-virtualization/workspace/main.json
+++ b/modules/desktop-virtualization/workspace/main.json
@@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
- "templateHash": "2244374453334498480"
+ "templateHash": "13505731187520194526"
},
"name": "Azure Virtual Desktop (AVD) Workspaces",
"description": "This module deploys an Azure Virtual Desktop (AVD) Workspace.",
@@ -357,7 +357,7 @@
"scope": "[format('Microsoft.DesktopVirtualization/workspaces/{0}', parameters('name'))]",
"name": "[guid(resourceId('Microsoft.DesktopVirtualization/workspaces', parameters('name')), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId, coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
"properties": {
- "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
+ "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], if(contains(coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)))]",
"principalId": "[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId]",
"description": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'description')]",
"principalType": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'principalType')]",
diff --git a/modules/desktop-virtualization/workspace/tests/e2e/max/main.test.bicep b/modules/desktop-virtualization/workspace/tests/e2e/max/main.test.bicep
index 92de7edff9..7e08439b65 100644
--- a/modules/desktop-virtualization/workspace/tests/e2e/max/main.test.bicep
+++ b/modules/desktop-virtualization/workspace/tests/e2e/max/main.test.bicep
@@ -88,7 +88,17 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
}
roleAssignments: [
{
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')
principalId: nestedDependencies.outputs.managedIdentityPrincipalId
principalType: 'ServicePrincipal'
}
diff --git a/modules/desktop-virtualization/workspace/tests/e2e/waf-aligned/main.test.bicep b/modules/desktop-virtualization/workspace/tests/e2e/waf-aligned/main.test.bicep
index 4de3839aa1..78a62c1b38 100644
--- a/modules/desktop-virtualization/workspace/tests/e2e/waf-aligned/main.test.bicep
+++ b/modules/desktop-virtualization/workspace/tests/e2e/waf-aligned/main.test.bicep
@@ -86,13 +86,6 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
kind: 'CanNotDelete'
name: 'myCustomLockName'
}
- roleAssignments: [
- {
- roleDefinitionIdOrName: 'Reader'
- principalId: nestedDependencies.outputs.managedIdentityPrincipalId
- principalType: 'ServicePrincipal'
- }
- ]
tags: {
'hidden-title': 'This is visible in the resource name'
Environment: 'Non-Prod'
diff --git a/modules/dev-test-lab/lab/README.md b/modules/dev-test-lab/lab/README.md
index 6970eecd5d..b062197091 100644
--- a/modules/dev-test-lab/lab/README.md
+++ b/modules/dev-test-lab/lab/README.md
@@ -247,7 +247,17 @@ module lab 'br:bicep/modules/dev-test-lab.lab:1.0.0' = {
{
principalId: ''
principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: ''
}
]
schedules: [
@@ -532,7 +542,17 @@ module lab 'br:bicep/modules/dev-test-lab.lab:1.0.0' = {
{
"principalId": "",
"principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
+ "roleDefinitionIdOrName": "Owner"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": "b24988ac-6180-42a0-ab88-20f7382dd24c"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": ""
}
]
},
@@ -785,13 +805,6 @@ module lab 'br:bicep/modules/dev-test-lab.lab:1.0.0' = {
}
]
premiumDataDisks: 'Enabled'
- roleAssignments: [
- {
- principalId: ''
- principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
- }
- ]
schedules: [
{
dailyRecurrence: {
@@ -1069,15 +1082,6 @@ module lab 'br:bicep/modules/dev-test-lab.lab:1.0.0' = {
"premiumDataDisks": {
"value": "Enabled"
},
- "roleAssignments": {
- "value": [
- {
- "principalId": "",
- "principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
- }
- ]
- },
"schedules": {
"value": [
{
@@ -1464,7 +1468,7 @@ Array of role assignment objects that contain the 'roleDefinitionIdOrName' and '
| [`description`](#parameter-roleassignmentsdescription) | No | string | Optional. The description of the role assignment. |
| [`principalId`](#parameter-roleassignmentsprincipalid) | Yes | string | Required. The principal ID of the principal (user/group/identity) to assign the role to. |
| [`principalType`](#parameter-roleassignmentsprincipaltype) | No | string | Optional. The principal type of the assigned principal ID. |
-| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead. |
+| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
### Parameter: `roleAssignments.condition`
@@ -1512,7 +1516,7 @@ Optional. The principal type of the assigned principal ID.
### Parameter: `roleAssignments.roleDefinitionIdOrName`
-Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.
+Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
- Required: Yes
- Type: string
diff --git a/modules/dev-test-lab/lab/main.bicep b/modules/dev-test-lab/lab/main.bicep
index 784eb271af..75e9e340d9 100644
--- a/modules/dev-test-lab/lab/main.bicep
+++ b/modules/dev-test-lab/lab/main.bicep
@@ -292,7 +292,7 @@ module lab_costs 'cost/main.bicep' = if (!empty(costs)) {
resource lab_roleAssignments 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for (roleAssignment, index) in (roleAssignments ?? []): {
name: guid(lab.id, roleAssignment.principalId, roleAssignment.roleDefinitionIdOrName)
properties: {
- roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : roleAssignment.roleDefinitionIdOrName
+ roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : contains(roleAssignment.roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/') ? roleAssignment.roleDefinitionIdOrName : subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleAssignment.roleDefinitionIdOrName)
principalId: roleAssignment.principalId
description: roleAssignment.?description
principalType: roleAssignment.?principalType
@@ -339,7 +339,7 @@ type lockType = {
}?
type roleAssignmentType = {
- @description('Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.')
+ @description('Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
roleDefinitionIdOrName: string
@description('Required. The principal ID of the principal (user/group/identity) to assign the role to.')
diff --git a/modules/dev-test-lab/lab/main.json b/modules/dev-test-lab/lab/main.json
index 049a0fad52..a5bb38da18 100644
--- a/modules/dev-test-lab/lab/main.json
+++ b/modules/dev-test-lab/lab/main.json
@@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
- "templateHash": "10325694451607731112"
+ "templateHash": "335466902333101649"
},
"name": "DevTest Labs",
"description": "This module deploys a DevTest Lab.",
@@ -61,7 +61,7 @@
"roleDefinitionIdOrName": {
"type": "string",
"metadata": {
- "description": "Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead."
+ "description": "Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
}
},
"principalId": {
@@ -431,7 +431,7 @@
"scope": "[format('Microsoft.DevTestLab/labs/{0}', parameters('name'))]",
"name": "[guid(resourceId('Microsoft.DevTestLab/labs', parameters('name')), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId, coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
"properties": {
- "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
+ "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], if(contains(coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)))]",
"principalId": "[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId]",
"description": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'description')]",
"principalType": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'principalType')]",
@@ -484,10 +484,10 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
- "templateHash": "15407797032940609921"
+ "templateHash": "2685254804143459925"
},
"name": "DevTest Lab Virtual Networks",
- "description": "This module deploys a DevTest Lab Virtual Network.\r\n\r\nLab virtual machines must be deployed into a virtual network. This resource type allows configuring the virtual network and subnet settings used for the lab virtual machines.",
+ "description": "This module deploys a DevTest Lab Virtual Network.\n\nLab virtual machines must be deployed into a virtual network. This resource type allows configuring the virtual network and subnet settings used for the lab virtual machines.",
"owner": "Azure/module-maintainers"
},
"parameters": {
@@ -657,10 +657,10 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
- "templateHash": "9914622679648067397"
+ "templateHash": "5652685942577853564"
},
"name": "DevTest Lab Policy Sets Policies",
- "description": "This module deploys a DevTest Lab Policy Sets Policy.\r\n\r\nDevTest lab policies are used to modify the lab settings such as only allowing certain VM Size SKUs, marketplace image types, number of VMs allowed per user and other settings.",
+ "description": "This module deploys a DevTest Lab Policy Sets Policy.\n\nDevTest lab policies are used to modify the lab settings such as only allowing certain VM Size SKUs, marketplace image types, number of VMs allowed per user and other settings.",
"owner": "Azure/module-maintainers"
},
"parameters": {
@@ -862,10 +862,10 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
- "templateHash": "12981849767656574818"
+ "templateHash": "1015942076148002236"
},
"name": "DevTest Lab Schedules",
- "description": "This module deploys a DevTest Lab Schedule.\r\n\r\nLab schedules are used to modify the settings for auto-shutdown, auto-start for lab virtual machines.",
+ "description": "This module deploys a DevTest Lab Schedule.\n\nLab schedules are used to modify the settings for auto-shutdown, auto-start for lab virtual machines.",
"owner": "Azure/module-maintainers"
},
"parameters": {
@@ -1086,10 +1086,10 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
- "templateHash": "18307130406875558192"
+ "templateHash": "421100563759718119"
},
"name": "DevTest Lab Notification Channels",
- "description": "This module deploys a DevTest Lab Notification Channel.\r\n\r\nNotification channels are used by the schedule resource type in order to send notifications or events to email addresses and/or webhooks.",
+ "description": "This module deploys a DevTest Lab Notification Channel.\n\nNotification channels are used by the schedule resource type in order to send notifications or events to email addresses and/or webhooks.",
"owner": "Azure/module-maintainers"
},
"parameters": {
@@ -1270,10 +1270,10 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
- "templateHash": "2347337632859394324"
+ "templateHash": "7965418783863447380"
},
"name": "DevTest Lab Artifact Sources",
- "description": "This module deploys a DevTest Lab Artifact Source.\r\n\r\nAn artifact source allows you to create custom artifacts for the VMs in the lab, or use Azure Resource Manager templates to create a custom test environment. You must add a private Git repository for the artifacts or Resource Manager templates that your team creates. The repository can be hosted on GitHub or on Azure DevOps Services.",
+ "description": "This module deploys a DevTest Lab Artifact Source.\n\nAn artifact source allows you to create custom artifacts for the VMs in the lab, or use Azure Resource Manager templates to create a custom test environment. You must add a private Git repository for the artifacts or Resource Manager templates that your team creates. The repository can be hosted on GitHub or on Azure DevOps Services.",
"owner": "Azure/module-maintainers"
},
"parameters": {
@@ -1486,10 +1486,10 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
- "templateHash": "12516166788941938286"
+ "templateHash": "14581778776350915706"
},
"name": "DevTest Lab Costs",
- "description": "This module deploys a DevTest Lab Cost.\r\n\r\nManage lab costs by setting a spending target that can be viewed in the Monthly Estimated Cost Trend chart. DevTest Labs can send a notification when spending reaches the specified target threshold.",
+ "description": "This module deploys a DevTest Lab Cost.\n\nManage lab costs by setting a spending target that can be viewed in the Monthly Estimated Cost Trend chart. DevTest Labs can send a notification when spending reaches the specified target threshold.",
"owner": "Azure/module-maintainers"
},
"parameters": {
diff --git a/modules/dev-test-lab/lab/tests/e2e/max/main.test.bicep b/modules/dev-test-lab/lab/tests/e2e/max/main.test.bicep
index c93e8c1ec2..21a1faa4f9 100644
--- a/modules/dev-test-lab/lab/tests/e2e/max/main.test.bicep
+++ b/modules/dev-test-lab/lab/tests/e2e/max/main.test.bicep
@@ -68,7 +68,17 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
}
roleAssignments: [
{
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')
principalId: nestedDependencies.outputs.managedIdentityPrincipalId
principalType: 'ServicePrincipal'
}
diff --git a/modules/dev-test-lab/lab/tests/e2e/waf-aligned/main.test.bicep b/modules/dev-test-lab/lab/tests/e2e/waf-aligned/main.test.bicep
index 2fe087e82c..fb32ba4ed3 100644
--- a/modules/dev-test-lab/lab/tests/e2e/waf-aligned/main.test.bicep
+++ b/modules/dev-test-lab/lab/tests/e2e/waf-aligned/main.test.bicep
@@ -66,13 +66,6 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
kind: 'CanNotDelete'
name: 'myCustomLockName'
}
- roleAssignments: [
- {
- roleDefinitionIdOrName: 'Reader'
- principalId: nestedDependencies.outputs.managedIdentityPrincipalId
- principalType: 'ServicePrincipal'
- }
- ]
tags: {
'hidden-title': 'This is visible in the resource name'
resourceType: 'DevTest Lab'
diff --git a/modules/digital-twins/digital-twins-instance/README.md b/modules/digital-twins/digital-twins-instance/README.md
index a972da2410..b17f411ae0 100644
--- a/modules/digital-twins/digital-twins-instance/README.md
+++ b/modules/digital-twins/digital-twins-instance/README.md
@@ -716,7 +716,7 @@ Configuration details for private endpoints. For security reasons, it is recomme
| [`name`](#parameter-privateendpointsname) | No | string | Optional. The name of the private endpoint. |
| [`privateDnsZoneGroupName`](#parameter-privateendpointsprivatednszonegroupname) | No | string | Optional. The name of the private DNS zone group to create if privateDnsZoneResourceIds were provided. |
| [`privateDnsZoneResourceIds`](#parameter-privateendpointsprivatednszoneresourceids) | No | array | Optional. The private DNS zone groups to associate the private endpoint with. A DNS zone group can support up to 5 DNS zones. |
-| [`roleAssignments`](#parameter-privateendpointsroleassignments) | No | array | Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
+| [`roleAssignments`](#parameter-privateendpointsroleassignments) | No | array | Optional. Array of role assignments to create. |
| [`service`](#parameter-privateendpointsservice) | No | string | Optional. The service (sub-) type to deploy the private endpoint for. For example "vault" or "blob". |
| [`subnetResourceId`](#parameter-privateendpointssubnetresourceid) | Yes | string | Required. Resource ID of the subnet where the endpoint needs to be created. |
| [`tags`](#parameter-privateendpointstags) | No | object | Optional. Tags to be applied on all resources/resource groups in this deployment. |
@@ -868,7 +868,7 @@ Optional. The private DNS zone groups to associate the private endpoint with. A
### Parameter: `privateEndpoints.roleAssignments`
-Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
+Optional. Array of role assignments to create.
- Required: No
- Type: array
@@ -924,7 +924,7 @@ Array of role assignment objects that contain the 'roleDefinitionIdOrName' and '
| [`description`](#parameter-roleassignmentsdescription) | No | string | Optional. The description of the role assignment. |
| [`principalId`](#parameter-roleassignmentsprincipalid) | Yes | string | Required. The principal ID of the principal (user/group/identity) to assign the role to. |
| [`principalType`](#parameter-roleassignmentsprincipaltype) | No | string | Optional. The principal type of the assigned principal ID. |
-| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead. |
+| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
### Parameter: `roleAssignments.condition`
@@ -972,7 +972,7 @@ Optional. The principal type of the assigned principal ID.
### Parameter: `roleAssignments.roleDefinitionIdOrName`
-Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.
+Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
- Required: Yes
- Type: string
diff --git a/modules/digital-twins/digital-twins-instance/main.bicep b/modules/digital-twins/digital-twins-instance/main.bicep
index 435fbefba7..d70d7c7c03 100644
--- a/modules/digital-twins/digital-twins-instance/main.bicep
+++ b/modules/digital-twins/digital-twins-instance/main.bicep
@@ -198,7 +198,7 @@ resource digitalTwinsInstance_diagnosticSettings 'Microsoft.Insights/diagnosticS
resource digitalTwinsInstance_roleAssignments 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for (roleAssignment, index) in (roleAssignments ?? []): {
name: guid(digitalTwinsInstance.id, roleAssignment.principalId, roleAssignment.roleDefinitionIdOrName)
properties: {
- roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : roleAssignment.roleDefinitionIdOrName
+ roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : contains(roleAssignment.roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/') ? roleAssignment.roleDefinitionIdOrName : subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleAssignment.roleDefinitionIdOrName)
principalId: roleAssignment.principalId
description: roleAssignment.?description
principalType: roleAssignment.?principalType
@@ -248,7 +248,7 @@ type lockType = {
}?
type roleAssignmentType = {
- @description('Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.')
+ @description('Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
roleDefinitionIdOrName: string
@description('Required. The principal ID of the principal (user/group/identity) to assign the role to.')
@@ -325,7 +325,7 @@ type privateEndpointType = {
@description('Optional. Specify the type of lock.')
lock: lockType
- @description('Optional. Array of role assignment objects that contain the \'roleDefinitionIdOrName\' and \'principalId\' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
+ @description('Optional. Array of role assignments to create.')
roleAssignments: roleAssignmentType
@description('Optional. Tags to be applied on all resources/resource groups in this deployment.')
diff --git a/modules/digital-twins/digital-twins-instance/main.json b/modules/digital-twins/digital-twins-instance/main.json
index 6906b63c09..418e025eaf 100644
--- a/modules/digital-twins/digital-twins-instance/main.json
+++ b/modules/digital-twins/digital-twins-instance/main.json
@@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
- "templateHash": "8178960412871211847"
+ "templateHash": "10882496143186980105"
},
"name": "Digital Twins Instances",
"description": "This module deploys an Azure Digital Twins Instance.",
@@ -69,7 +69,7 @@
"roleDefinitionIdOrName": {
"type": "string",
"metadata": {
- "description": "Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead."
+ "description": "Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
}
},
"principalId": {
@@ -274,7 +274,7 @@
"roleAssignments": {
"$ref": "#/definitions/roleAssignmentType",
"metadata": {
- "description": "Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
+ "description": "Optional. Array of role assignments to create."
}
},
"tags": {
@@ -590,7 +590,7 @@
"scope": "[format('Microsoft.DigitalTwins/digitalTwinsInstances/{0}', parameters('name'))]",
"name": "[guid(resourceId('Microsoft.DigitalTwins/digitalTwinsInstances', parameters('name')), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId, coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
"properties": {
- "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
+ "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], if(contains(coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)))]",
"principalId": "[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId]",
"description": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'description')]",
"principalType": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'principalType')]",
diff --git a/modules/document-db/database-account/README.md b/modules/document-db/database-account/README.md
index 2c1640c6c2..d9167cbc22 100644
--- a/modules/document-db/database-account/README.md
+++ b/modules/document-db/database-account/README.md
@@ -139,7 +139,17 @@ module databaseAccount 'br:bicep/modules/document-db.database-account:1.0.0' = {
{
principalId: ''
principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: ''
}
]
tags: {
@@ -269,7 +279,17 @@ module databaseAccount 'br:bicep/modules/document-db.database-account:1.0.0' = {
{
"principalId": "",
"principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
+ "roleDefinitionIdOrName": "Owner"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": "b24988ac-6180-42a0-ab88-20f7382dd24c"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": ""
}
]
},
@@ -519,7 +539,17 @@ module databaseAccount 'br:bicep/modules/document-db.database-account:1.0.0' = {
{
principalId: ''
principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: ''
}
]
tags: {
@@ -780,7 +810,17 @@ module databaseAccount 'br:bicep/modules/document-db.database-account:1.0.0' = {
{
"principalId": "",
"principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
+ "roleDefinitionIdOrName": "Owner"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": "b24988ac-6180-42a0-ab88-20f7382dd24c"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": ""
}
]
},
@@ -846,7 +886,17 @@ module databaseAccount 'br:bicep/modules/document-db.database-account:1.0.0' = {
{
principalId: ''
principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: ''
}
]
tags: {
@@ -919,7 +969,17 @@ module databaseAccount 'br:bicep/modules/document-db.database-account:1.0.0' = {
{
"principalId": "",
"principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
+ "roleDefinitionIdOrName": "Owner"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": "b24988ac-6180-42a0-ab88-20f7382dd24c"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": ""
}
]
},
@@ -1001,7 +1061,17 @@ module databaseAccount 'br:bicep/modules/document-db.database-account:1.0.0' = {
{
principalId: ''
principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ }
+ {
+ principalId: ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionIdOrName: ''
}
]
sqlDatabases: [
@@ -1170,7 +1240,17 @@ module databaseAccount 'br:bicep/modules/document-db.database-account:1.0.0' = {
{
"principalId": "",
"principalType": "ServicePrincipal",
- "roleDefinitionIdOrName": "Reader"
+ "roleDefinitionIdOrName": "Owner"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": "b24988ac-6180-42a0-ab88-20f7382dd24c"
+ },
+ {
+ "principalId": "",
+ "principalType": "ServicePrincipal",
+ "roleDefinitionIdOrName": ""
}
]
},
@@ -1666,7 +1746,7 @@ Configuration details for private endpoints. For security reasons, it is recomme
| [`name`](#parameter-privateendpointsname) | No | string | Optional. The name of the private endpoint. |
| [`privateDnsZoneGroupName`](#parameter-privateendpointsprivatednszonegroupname) | No | string | Optional. The name of the private DNS zone group to create if privateDnsZoneResourceIds were provided. |
| [`privateDnsZoneResourceIds`](#parameter-privateendpointsprivatednszoneresourceids) | No | array | Optional. The private DNS zone groups to associate the private endpoint with. A DNS zone group can support up to 5 DNS zones. |
-| [`roleAssignments`](#parameter-privateendpointsroleassignments) | No | array | Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
+| [`roleAssignments`](#parameter-privateendpointsroleassignments) | No | array | Optional. Array of role assignments to create. |
| [`service`](#parameter-privateendpointsservice) | Yes | string | Required. The service (sub-) type to deploy the private endpoint for. For example "vault" or "blob". |
| [`subnetResourceId`](#parameter-privateendpointssubnetresourceid) | Yes | string | Required. Resource ID of the subnet where the endpoint needs to be created. |
| [`tags`](#parameter-privateendpointstags) | No | object | Optional. Tags to be applied on all resources/resource groups in this deployment. |
@@ -1818,7 +1898,7 @@ Optional. The private DNS zone groups to associate the private endpoint with. A
### Parameter: `privateEndpoints.roleAssignments`
-Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
+Optional. Array of role assignments to create.
- Required: No
- Type: array
@@ -1859,7 +1939,7 @@ Array of role assignment objects that contain the 'roleDefinitionIdOrName' and '
| [`description`](#parameter-roleassignmentsdescription) | No | string | Optional. The description of the role assignment. |
| [`principalId`](#parameter-roleassignmentsprincipalid) | Yes | string | Required. The principal ID of the principal (user/group/identity) to assign the role to. |
| [`principalType`](#parameter-roleassignmentsprincipaltype) | No | string | Optional. The principal type of the assigned principal ID. |
-| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead. |
+| [`roleDefinitionIdOrName`](#parameter-roleassignmentsroledefinitionidorname) | Yes | string | Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
### Parameter: `roleAssignments.condition`
@@ -1907,7 +1987,7 @@ Optional. The principal type of the assigned principal ID.
### Parameter: `roleAssignments.roleDefinitionIdOrName`
-Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.
+Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
- Required: Yes
- Type: string
diff --git a/modules/document-db/database-account/main.bicep b/modules/document-db/database-account/main.bicep
index c59540db7f..728a5b2274 100644
--- a/modules/document-db/database-account/main.bicep
+++ b/modules/document-db/database-account/main.bicep
@@ -271,7 +271,7 @@ resource databaseAccount_diagnosticSettings 'Microsoft.Insights/diagnosticSettin
resource databaseAccount_roleAssignments 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for (roleAssignment, index) in (roleAssignments ?? []): {
name: guid(databaseAccount.id, roleAssignment.principalId, roleAssignment.roleDefinitionIdOrName)
properties: {
- roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : roleAssignment.roleDefinitionIdOrName
+ roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : contains(roleAssignment.roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/') ? roleAssignment.roleDefinitionIdOrName : subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleAssignment.roleDefinitionIdOrName)
principalId: roleAssignment.principalId
description: roleAssignment.?description
principalType: roleAssignment.?principalType
@@ -374,7 +374,7 @@ type lockType = {
}?
type roleAssignmentType = {
- @description('Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.')
+ @description('Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
roleDefinitionIdOrName: string
@description('Required. The principal ID of the principal (user/group/identity) to assign the role to.')
@@ -451,7 +451,7 @@ type privateEndpointType = {
@description('Optional. Specify the type of lock.')
lock: lockType
- @description('Optional. Array of role assignment objects that contain the \'roleDefinitionIdOrName\' and \'principalId\' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
+ @description('Optional. Array of role assignments to create.')
roleAssignments: roleAssignmentType
@description('Optional. Tags to be applied on all resources/resource groups in this deployment.')
diff --git a/modules/document-db/database-account/main.json b/modules/document-db/database-account/main.json
index 5f9de4eea6..2b2a72a670 100644
--- a/modules/document-db/database-account/main.json
+++ b/modules/document-db/database-account/main.json
@@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
- "templateHash": "6369048122051620701"
+ "templateHash": "17655203248795781813"
},
"name": "DocumentDB Database Accounts",
"description": "This module deploys a DocumentDB Database Account.",
@@ -69,7 +69,7 @@
"roleDefinitionIdOrName": {
"type": "string",
"metadata": {
- "description": "Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead."
+ "description": "Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
}
},
"principalId": {
@@ -273,7 +273,7 @@
"roleAssignments": {
"$ref": "#/definitions/roleAssignmentType",
"metadata": {
- "description": "Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
+ "description": "Optional. Array of role assignments to create."
}
},
"tags": {
@@ -759,7 +759,7 @@
"scope": "[format('Microsoft.DocumentDB/databaseAccounts/{0}', parameters('name'))]",
"name": "[guid(resourceId('Microsoft.DocumentDB/databaseAccounts', parameters('name')), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId, coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
"properties": {
- "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)]",
+ "roleDefinitionId": "[if(contains(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName), variables('builtInRoleNames')[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName], if(contains(coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/'), coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', coalesce(parameters('roleAssignments'), createArray())[copyIndex()].roleDefinitionIdOrName)))]",
"principalId": "[coalesce(parameters('roleAssignments'), createArray())[copyIndex()].principalId]",
"description": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'description')]",
"principalType": "[tryGet(coalesce(parameters('roleAssignments'), createArray())[copyIndex()], 'principalType')]",
diff --git a/modules/document-db/database-account/tests/e2e/gremlindb/main.test.bicep b/modules/document-db/database-account/tests/e2e/gremlindb/main.test.bicep
index 44f12410b3..49de1571cd 100644
--- a/modules/document-db/database-account/tests/e2e/gremlindb/main.test.bicep
+++ b/modules/document-db/database-account/tests/e2e/gremlindb/main.test.bicep
@@ -144,7 +144,17 @@ module testDeployment '../../../main.bicep' = {
location: location
roleAssignments: [
{
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')
principalId: nestedDependencies.outputs.managedIdentityPrincipalId
principalType: 'ServicePrincipal'
}
diff --git a/modules/document-db/database-account/tests/e2e/mongodb/main.test.bicep b/modules/document-db/database-account/tests/e2e/mongodb/main.test.bicep
index ddb9ac1a75..6acaad1ecb 100644
--- a/modules/document-db/database-account/tests/e2e/mongodb/main.test.bicep
+++ b/modules/document-db/database-account/tests/e2e/mongodb/main.test.bicep
@@ -277,7 +277,17 @@ module testDeployment '../../../main.bicep' = {
]
roleAssignments: [
{
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')
principalId: nestedDependencies.outputs.managedIdentityPrincipalId
principalType: 'ServicePrincipal'
}
diff --git a/modules/document-db/database-account/tests/e2e/plain/main.test.bicep b/modules/document-db/database-account/tests/e2e/plain/main.test.bicep
index c8dbd06e37..2b71669ee2 100644
--- a/modules/document-db/database-account/tests/e2e/plain/main.test.bicep
+++ b/modules/document-db/database-account/tests/e2e/plain/main.test.bicep
@@ -96,7 +96,17 @@ module testDeployment '../../../main.bicep' = {
}
roleAssignments: [
{
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')
principalId: nestedDependencies.outputs.managedIdentityPrincipalId
principalType: 'ServicePrincipal'
}
diff --git a/modules/document-db/database-account/tests/e2e/sqldb/main.test.bicep b/modules/document-db/database-account/tests/e2e/sqldb/main.test.bicep
index aacecc5a6c..843e9e6afe 100644
--- a/modules/document-db/database-account/tests/e2e/sqldb/main.test.bicep
+++ b/modules/document-db/database-account/tests/e2e/sqldb/main.test.bicep
@@ -108,7 +108,17 @@ module testDeployment '../../../main.bicep' = {
]
roleAssignments: [
{
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+ principalId: nestedDependencies.outputs.managedIdentityPrincipalId
+ principalType: 'ServicePrincipal'
+ }
+ {
+ roleDefinitionIdOrName: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')
principalId: nestedDependencies.outputs.managedIdentityPrincipalId
principalType: 'ServicePrincipal'
}
diff --git a/modules/event-hub/namespace/README.md b/modules/event-hub/namespace/README.md
index 3fb31b9d56..faca598780 100644
--- a/modules/event-hub/namespace/README.md
+++ b/modules/event-hub/namespace/README.md
@@ -346,7 +346,17 @@ module namespace 'br:bicep/modules/event-hub.namespace:1.0.0' = {
{
principalId: ''
principalType: 'ServicePrincipal'
- roleDefinitionIdOrName: 'Reader'
+ roleDefinitionIdOrName: 'Owner'
+ }
+ {
+ principalId: '