From 9f30af3c9ad4a0231ee56b8ce584b34430d35f69 Mon Sep 17 00:00:00 2001 From: Brunoga-MS Date: Fri, 19 Jan 2024 12:41:20 +0100 Subject: [PATCH 1/2] Aligning deployment prefixes --- patterns/alz/alzArm.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/patterns/alz/alzArm.json b/patterns/alz/alzArm.json index 6049e245a..d34b0dd43 100644 --- a/patterns/alz/alzArm.json +++ b/patterns/alz/alzArm.json @@ -190,13 +190,13 @@ "AMBAManagementDeploymentName": "[take(concat('amba-Management', variables('deploymentSuffix')), 64)]", "AMBAServiceHealthDeploymentName": "[take(concat('amba-ServiceHealth', variables('deploymentSuffix')), 64)]", "AMBANotificationAssetsDeploymentName": "[take(concat('amba-NotificationAssets', variables('deploymentSuffix')), 64)]", - "pidCuaDeploymentName": "[take(concat('pid-', variables('cuaid'), '-' , uniqueString(deployment().location, parameters('enterpriseScaleCompanyPrefix'), parameters('currentDateTimeUtcNow'))), 64)]", - "pidCuaConnectivityDeploymentName": "[take(concat('pid-', variables('cuaidConnectivity'), '-' , uniqueString(deployment().location, parameters('enterpriseScaleCompanyPrefix'), parameters('currentDateTimeUtcNow'))), 64)]", - "pidCuaIdentityDeploymentName": "[take(concat('pid-', variables('cuaidIdentity'), '-' , uniqueString(deployment().location, parameters('enterpriseScaleCompanyPrefix'), parameters('currentDateTimeUtcNow'))), 64)]", - "pidCuaManagementDeploymentName": "[take(concat('pid-', variables('cuaidManagement'), '-' , uniqueString(deployment().location, parameters('enterpriseScaleCompanyPrefix'), parameters('currentDateTimeUtcNow'))), 64)]", - "pidCuaLandingZoneDeploymentName": "[take(concat('pid-', variables('cuaidLandingZone'), '-' , uniqueString(deployment().location, parameters('enterpriseScaleCompanyPrefix'), parameters('currentDateTimeUtcNow'))), 64)]", - "pidCuaServiceHealthDeploymentName": "[take(concat('pid-', variables('cuaidServiceHealth'), '-' , uniqueString(deployment().location, parameters('enterpriseScaleCompanyPrefix'), parameters('currentDateTimeUtcNow'))), 64)]", - "pidCuaNotificationAssetsDeploymentName": "[take(concat('pid-', variables('cuaidNotificationAssets'), '-' , uniqueString(deployment().location, parameters('enterpriseScaleCompanyPrefix'), parameters('currentDateTimeUtcNow'))), 64)]" + "pidCuaDeploymentName": "[take(concat('amba-pid-', variables('cuaid'), '-' , uniqueString(deployment().location, parameters('enterpriseScaleCompanyPrefix'), parameters('currentDateTimeUtcNow'))), 64)]", + "pidCuaConnectivityDeploymentName": "[take(concat('amba-pid-', variables('cuaidConnectivity'), '-' , uniqueString(deployment().location, parameters('enterpriseScaleCompanyPrefix'), parameters('currentDateTimeUtcNow'))), 64)]", + "pidCuaIdentityDeploymentName": "[take(concat('amba-pid-', variables('cuaidIdentity'), '-' , uniqueString(deployment().location, parameters('enterpriseScaleCompanyPrefix'), parameters('currentDateTimeUtcNow'))), 64)]", + "pidCuaManagementDeploymentName": "[take(concat('amba-pid-', variables('cuaidManagement'), '-' , uniqueString(deployment().location, parameters('enterpriseScaleCompanyPrefix'), parameters('currentDateTimeUtcNow'))), 64)]", + "pidCuaLandingZoneDeploymentName": "[take(concat('amba-pid-', variables('cuaidLandingZone'), '-' , uniqueString(deployment().location, parameters('enterpriseScaleCompanyPrefix'), parameters('currentDateTimeUtcNow'))), 64)]", + "pidCuaServiceHealthDeploymentName": "[take(concat('amba-pid-', variables('cuaidServiceHealth'), '-' , uniqueString(deployment().location, parameters('enterpriseScaleCompanyPrefix'), parameters('currentDateTimeUtcNow'))), 64)]", + "pidCuaNotificationAssetsDeploymentName": "[take(concat('amba-pid-', variables('cuaidNotificationAssets'), '-' , uniqueString(deployment().location, parameters('enterpriseScaleCompanyPrefix'), parameters('currentDateTimeUtcNow'))), 64)]" }, "cuaid": "d6b3b08c-5825-4b89-a62b-e3168d3d8fb0", "cuaidConnectivity": "2d69aa07-8780-4697-a431-79882cb9f00e", @@ -235,7 +235,7 @@ // One of Azure's untold stories..... "type": "Microsoft.Resources/deployments", "apiVersion": "2020-10-01", - "name": "[concat('ambaPreparingToLaunch', copyIndex())]", + "name": "[concat('amba-PreparingToLaunch', copyIndex())]", "location": "[deployment().location]", "scope": "[concat('Microsoft.Management/managementGroups/', parameters('enterpriseScaleCompanyPrefix'))]", "dependsOn": [ From 883148307deab95d076e356892635b7834460565 Mon Sep 17 00:00:00 2001 From: Brunoga-MS Date: Fri, 19 Jan 2024 14:55:52 +0100 Subject: [PATCH 2/2] aligning pseudoRootManagementGroup parameter name with variable name to avoid confusion --- patterns/alz/scripts/Start-AMBACleanup.ps1 | 4 ++-- patterns/alz/scripts/Start-AMBAOldArpCleanup.ps1 | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/patterns/alz/scripts/Start-AMBACleanup.ps1 b/patterns/alz/scripts/Start-AMBACleanup.ps1 index 19635b026..829bee2fb 100644 --- a/patterns/alz/scripts/Start-AMBACleanup.ps1 +++ b/patterns/alz/scripts/Start-AMBACleanup.ps1 @@ -32,7 +32,7 @@ param( # the pseudo managemnt group to start from [Parameter(Mandatory=$True, ValueFromPipeline=$false)] - [string]$pseudoManagementGroup, + [string]$pseudoRootManagementGroup, # output a list of the resources to be deleted [Parameter(Mandatory=$False, ValueFromPipeline=$false)] @@ -113,7 +113,7 @@ If (-NOT(Get-Module -ListAvailable Az.ResourceGraph)) { # get all management groups -- used in graph query scope $managementGroups = @() -$allMgs = Get-AzManagementGroup -GroupName $pseudoManagementGroup -Expand -Recurse +$allMgs = Get-AzManagementGroup -GroupName $pseudoRootManagementGroup -Expand -Recurse foreach ($mg in $allMgs) { Iterate-ManagementGroups $mg } diff --git a/patterns/alz/scripts/Start-AMBAOldArpCleanup.ps1 b/patterns/alz/scripts/Start-AMBAOldArpCleanup.ps1 index 9ba64a3b4..adb473c48 100644 --- a/patterns/alz/scripts/Start-AMBAOldArpCleanup.ps1 +++ b/patterns/alz/scripts/Start-AMBAOldArpCleanup.ps1 @@ -33,7 +33,7 @@ param( # the pseudo managemnt group to start from [Parameter(Mandatory=$True, ValueFromPipeline=$false)] - [string]$pseudoManagementGroup, + [string]$pseudoRootManagementGroup, # output a list of the resources to be deleted [Parameter(Mandatory=$False, ValueFromPipeline=$false)] @@ -114,7 +114,7 @@ If (-NOT(Get-Module -ListAvailable Az.ResourceGraph)) { # get all management groups -- used in graph query scope $managementGroups = @() -$allMgs = Get-AzManagementGroup -GroupName $pseudoManagementGroup -Expand -Recurse +$allMgs = Get-AzManagementGroup -GroupName $pseudoRootManagementGroup -Expand -Recurse foreach ($mg in $allMgs) { Iterate-ManagementGroups $mg }