Skip to content

Commit

Permalink
fix guid for role assignments
Browse files Browse the repository at this point in the history
  • Loading branch information
jesseloudon committed Dec 11, 2021
1 parent e0c7a26 commit 389cb71
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Bicep/modules/assignments/sub_assignments.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ resource tagging_roleassignment 'Microsoft.Authorization/roleAssignments@2020-04
}

resource monitoring_roleassignment 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = {
name: guid(monitoring_assignment.name, monitoring_assignment.type)
name: guid(monitoring_assignment.name, monitoring_assignment.type, subscription().subscriptionId)
properties: {
principalId: monitoring_assignment.identity.principalId
principalType: 'ServicePrincipal'
Expand All @@ -189,7 +189,7 @@ resource monitoring_roleassignment 'Microsoft.Authorization/roleAssignments@2020
}

resource dp_roleassignment 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = {
name: guid(dp_assignment.name, dp_assignment.type)
name: guid(dp_assignment.name, dp_assignment.type, subscription().subscriptionId)
properties: {
principalId: dp_assignment.identity.principalId
principalType: 'ServicePrincipal'
Expand Down
12 changes: 6 additions & 6 deletions Bicep/modules/sub_main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"_generator": {
"name": "bicep",
"version": "0.4.1008.15138",
"templateHash": "2628997391571807231"
"templateHash": "4337484099195058772"
}
},
"parameters": {
Expand Down Expand Up @@ -1849,7 +1849,7 @@
"_generator": {
"name": "bicep",
"version": "0.4.1008.15138",
"templateHash": "9643589475006069147"
"templateHash": "4659925975839164403"
}
},
"parameters": {
Expand Down Expand Up @@ -2066,7 +2066,7 @@
{
"type": "Microsoft.Authorization/roleAssignments",
"apiVersion": "2020-04-01-preview",
"name": "[guid('monitoring_assignment', 'Microsoft.Authorization/policyAssignments')]",
"name": "[guid('monitoring_assignment', 'Microsoft.Authorization/policyAssignments', subscription().subscriptionId)]",
"properties": {
"principalId": "[reference(subscriptionResourceId('Microsoft.Authorization/policyAssignments', 'monitoring_assignment'), '2020-09-01', 'full').identity.principalId]",
"principalType": "ServicePrincipal",
Expand All @@ -2079,7 +2079,7 @@
{
"type": "Microsoft.Authorization/roleAssignments",
"apiVersion": "2020-04-01-preview",
"name": "[guid('dp_assignment', 'Microsoft.Authorization/policyAssignments')]",
"name": "[guid('dp_assignment', 'Microsoft.Authorization/policyAssignments', subscription().subscriptionId)]",
"properties": {
"principalId": "[reference(subscriptionResourceId('Microsoft.Authorization/policyAssignments', 'dp_assignment'), '2020-09-01', 'full').identity.principalId]",
"principalType": "ServicePrincipal",
Expand All @@ -2105,8 +2105,8 @@
"type": "array",
"value": [
"[subscriptionResourceId('Microsoft.Authorization/roleAssignments', guid('tagging_assignment', 'Microsoft.Authorization/policyAssignments', subscription().subscriptionId))]",
"[subscriptionResourceId('Microsoft.Authorization/roleAssignments', guid('monitoring_assignment', 'Microsoft.Authorization/policyAssignments'))]",
"[subscriptionResourceId('Microsoft.Authorization/roleAssignments', guid('dp_assignment', 'Microsoft.Authorization/policyAssignments'))]"
"[subscriptionResourceId('Microsoft.Authorization/roleAssignments', guid('monitoring_assignment', 'Microsoft.Authorization/policyAssignments', subscription().subscriptionId))]",
"[subscriptionResourceId('Microsoft.Authorization/roleAssignments', guid('dp_assignment', 'Microsoft.Authorization/policyAssignments', subscription().subscriptionId))]"
]
}
}
Expand Down

0 comments on commit 389cb71

Please sign in to comment.