From 9a82f68593b2d9da0ff6e6535bb27506b2d8e24f Mon Sep 17 00:00:00 2001 From: Patrick El-Azem
Date: Sat, 20 Apr 2024 15:30:11 -0400 Subject: [PATCH] Fix role assignment deployment names for multi-location matrix deployments --- scripts/AzureSecurity.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/AzureSecurity.ps1 b/scripts/AzureSecurity.ps1 index fd64cf8..7228720 100644 --- a/scripts/AzureSecurity.ps1 +++ b/scripts/AzureSecurity.ps1 @@ -31,7 +31,7 @@ function Deploy-RoleAssignment() Write-Debug -Debug:$true -Message "Deploy Role Assignment: RoleDefinitionId=$RoleDefinitionId, PrincipalId=$PrincipalId, PrincipalType=$PrincipalType, ResourceGroupName=$ResourceGroupName, ResourceType=$ResourceType, ResourceName=$ResourceName" - $deploymentName = "rbac-" + $RoleDefinitionId + $deploymentName = "$Location-$ResourceName-$RoleDefinitionId" $output = az deployment sub create --verbose ` -n "$deploymentName" ` @@ -76,7 +76,7 @@ function Deploy-RoleAssignmentRg() Write-Debug -Debug:$true -Message "Deploy RG Role Assignment: RoleDefinitionId=$RoleDefinitionId, PrincipalId=$PrincipalId, PrincipalType=$PrincipalType, ResourceGroupName=$ResourceGroupName" - $deploymentName = "rbac-rg-" + $RoleDefinitionId + $deploymentName = "$Location-$ResourceGroupName-$RoleDefinitionId" $output = az deployment sub create --verbose ` -n "$deploymentName" ` @@ -116,7 +116,7 @@ function Deploy-RoleAssignmentSub() Write-Debug -Debug:$true -Message "Deploy Sub Role Assignment: RoleDefinitionId=$RoleDefinitionId, PrincipalId=$PrincipalId, PrincipalType=$PrincipalType" - $deploymentName = "rbac-sub-" + $RoleDefinitionId + $deploymentName = "$Location-$RoleDefinitionId" $output = az deployment sub create --verbose ` -n "$deploymentName" `