File tree Expand file tree Collapse file tree
azuredevops/pipelines/bicep/templates
github/actions/bicep/templates/actions/bicep-first-deployment-check Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ stages:
139139 azurePowerShellVersion : LatestVersion
140140 ScriptType : " InlineScript"
141141 Inline : |
142- $intRootMgId = "$(INTERMEDIATE_ROOT_MANAGEMENT_GROUP_ID)"
142+ $intRootMgId = "$(MANAGEMENT_GROUP_ID_PREFIX)$( INTERMEDIATE_ROOT_MANAGEMENT_GROUP_ID)$(MANAGEMENT_GROUP_ID_POSTFIX )"
143143
144144 $managementGroups = Get-AzManagementGroup
145145 $intRootMg = $managementGroups | Where-Object { $_.Name -eq $intRootMgId }
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ stages:
7878 azurePowerShellVersion : LatestVersion
7979 ScriptType : " InlineScript"
8080 Inline : |
81- $intRootMgId = "$(INTERMEDIATE_ROOT_MANAGEMENT_GROUP_ID)"
81+ $intRootMgId = "$(MANAGEMENT_GROUP_ID_PREFIX)$( INTERMEDIATE_ROOT_MANAGEMENT_GROUP_ID)$(MANAGEMENT_GROUP_ID_POSTFIX )"
8282
8383 $managementGroups = Get-AzManagementGroup
8484 $intRootMg = $managementGroups | Where-Object { $_.Name -eq $intRootMgId }
Original file line number Diff line number Diff line change 1515 with :
1616 azPSVersion : ' latest'
1717 inlineScript : |
18- # Read the int-root management group name from the bicepparam file
19- $intRootParamFile = "templates/core/governance/mgmt-groups/int-root/main.bicepparam"
20- if (Test-Path $intRootParamFile) {
21- $paramContent = Get-Content $intRootParamFile -Raw
22- if ($paramContent -match 'managementGroupName:\s*[''"](\w+)[''"]+') {
23- $intRootMgId = $matches[1]
24- Write-Host "Found int-root management group name in param file: $intRootMgId"
25- } else {
26- Write-Warning "Could not parse managementGroupName from $intRootParamFile, using default 'alz'"
27- $intRootMgId = "alz"
28- }
29- } else {
30- Write-Warning "Int-root param file not found at $intRootParamFile, using default 'alz'"
31- $intRootMgId = "alz"
32- }
33-
18+ $intRootMgId = $env:MANAGEMENT_GROUP_ID_PREFIX + $env:INTERMEDIATE_ROOT_MANAGEMENT_GROUP_ID + $env:MANAGEMENT_GROUP_ID_POSTFIX
19+
3420 $managementGroups = Get-AzManagementGroup
3521 $intRootMg = $managementGroups | Where-Object { $_.Name -eq $intRootMgId }
3622
You can’t perform that action at this time.
0 commit comments