Skip to content

Commit 922cc2e

Browse files
committed
Merge branch 'main' into feat/identity-module-and-container-app-jobs
Resolved conflicts and integrated new file_manipulation module from main. All Container App Jobs features preserved: - Identity module with federated credentials - Container App Jobs support with BYO mode - Separate ACA/ACI image configuration - Structured naming with location abbreviations New from main: - file_manipulation module for bicep-classic support - Updated CI/CD pipelines (bicep-classic variants) - Cleanup scripts improvements - Module refactoring (removed template_architecture_definition)
2 parents 46163c0 + 6f8a43b commit 922cc2e

99 files changed

Lines changed: 5724 additions & 2122 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.config/ALZ-Powershell.config.json

Lines changed: 1 addition & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -26,84 +26,13 @@
2626
"release_artifact_name": "starter_modules.zip",
2727
"release_artifact_root_path": ".",
2828
"release_artifact_config_file": ".config/ALZ-Powershell.config.json"
29-
3029
},
31-
"bicep": {
30+
"bicep-classic": {
3231
"url": "https://github.com/Azure/ALZ-Bicep",
3332
"release_artifact_name": "accelerator.zip",
3433
"release_artifact_root_path": ".",
3534
"release_artifact_config_file": "accelerator/.config/ALZ-Powershell-Auto.config.json"
3635
}
3736
}
38-
},
39-
"validators": {
40-
"auth_scheme": {
41-
"Type": "AllowedValues",
42-
"Description": "A valid authentication scheme e.g. 'WorkloadIdentityFederation'",
43-
"AllowedValues": {
44-
"Display": true,
45-
"Values": [
46-
"WorkloadIdentityFederation",
47-
"ManagedServiceIdentity"
48-
]
49-
}
50-
},
51-
"azure_subscription_id": {
52-
"Type": "Valid",
53-
"Description": "A valid subscription id GUID e.g. '12345678-1234-1234-1234-123456789012'",
54-
"Valid": "^( {){0,1}[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}(}){0,1}$"
55-
},
56-
"azure_name": {
57-
"Type": "Valid",
58-
"Description": "A valid Azure name e.g. 'my-azure-name'",
59-
"Valid": "^[a-zA-Z0-9]{2,10}(-[a-zA-Z0-9]{2,10}){0,1}(-[a-zA-Z0-9]{2,10})?$"
60-
},
61-
"azure_name_section": {
62-
"Type": "Valid",
63-
"Description": "A valid Azure name with no hyphens and limited length e.g. 'abcd'",
64-
"Valid": "^[a-zA-Z0-9]{2,10}$"
65-
},
66-
"guid": {
67-
"Type": "Valid",
68-
"Description": "A valid GUID e.g. '12345678-1234-1234-1234-123456789012'",
69-
"Valid": "^( {){0,1}[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}(}){0,1}$"
70-
},
71-
"cidr_range": {
72-
"Type": "Valid",
73-
"Description": "A valid CIDR range e.g '10.0.0.0/16'",
74-
"Valid": "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(/(3[0-2]|[1-2][0-9]|[0-9]))$"
75-
},
76-
"configuration_file_path": {
77-
"Type": "Valid",
78-
"Description": "A valid yaml or json configuration file path e.g. './my-folder/my-config-file.yaml' or `c:\\my-folder\\my-config-file.yaml`",
79-
"Valid": "^.+\\.(yaml|yml|json)$"
80-
},
81-
"network_type": {
82-
"Type": "AllowedValues",
83-
"Description": "Networking Type'",
84-
"AllowedValues": {
85-
"Display": true,
86-
"Values": [
87-
"hubNetworking",
88-
"hubNetworkingMultiRegion",
89-
"vwanConnectivity",
90-
"vwanConnectivityMultiRegion",
91-
"none"
92-
]
93-
}
94-
},
95-
"email": {
96-
"Type": "Valid",
97-
"Description": "A valid email address",
98-
"Valid": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$"
99-
},
100-
"azure_location": {
101-
"Type": "AllowedValues",
102-
"Description": "An Azure deployment location e.g. 'uksouth'",
103-
"AllowedValues": {
104-
"Display": false,
105-
"Values": [ "This is dynamically populated from Azure" ]
106-
}
107-
}
10837
}
10938
}

.github/linters/.yaml-lint.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@ extends: default
44
ignore: |
55
**/bicep/**/ci-template.yaml
66
**/bicep/**/cd-template.yaml
7+
**/bicep-classic/**/ci-template.yaml
8+
**/bicep-classic/**/cd-template.yaml
79
*bicep-templates.yaml
810
**/bicep/**/cd.yaml
11+
**/bicep-classic/**/cd.yaml
12+
**/bicep-classic/**/ci.yaml
913
1014
rules:
1115
# 500 chars should be enough, but don't fail if a line is longer
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# This file can be used to clean up Resource Groups if there has been an issue with the End to End tests.
2+
# CAUTION: Make sure you are connected to the correct subscription before running this script!
3+
$managementGroupFilter = "alz-r"
4+
if($managementGroupFilter -eq "")
5+
{
6+
throw "Please set a management group filter to avoid disaster!"
7+
}
8+
$subscriptionFilter = ""
9+
10+
$managementGroups = @(
11+
"dac8feee-8768-4fbd-9cf9-9d96d4718018",
12+
"alz-accelerator-parent-test"
13+
)
14+
15+
$subscriptions = @(
16+
"6be58818-3390-4c43-a3bb-2666110eeb66",
17+
"5331601a-985a-4f45-87d1-6b4156c8acf5",
18+
"bceedecb-9f0b-4aa3-9778-1d1fa92f289e",
19+
"9ebf45b8-555d-49c6-81fb-d27ca08f7c28",
20+
"eac9acf5-0a34-4db8-ae56-cdbcc7e2cf4c",
21+
"3a6bdc35-0830-41ac-b323-37a5a030e241",
22+
"c4332eb2-f966-47db-aa47-5d71e239d8aa",
23+
"0aeefd1c-62c7-4071-91ad-925899603976",
24+
"0d754f66-65b4-4f64-97f5-221f0174ad48"
25+
)
26+
27+
$roleDefinitionsFilter = "Azure Landing Zones"
28+
29+
$subscriptions | ForEach-Object -Parallel {
30+
$subscription = $_
31+
$subscriptionDetails = az account show --subscription $subscription | ConvertFrom-Json
32+
Write-Host "Processing subscription: $subscription - $($subscriptionDetails.name)"
33+
34+
$resourceGroups = @("")
35+
while ($resourceGroups.Count -gt 0) {
36+
if($subscriptionFilter -eq "")
37+
{
38+
$resourceGroups = az group list --subscription $subscription | ConvertFrom-Json
39+
}
40+
else
41+
{
42+
$resourceGroups = az group list --subscription $subscription --query "[?contains(name, '$subscriptionFilter')]" | ConvertFrom-Json
43+
}
44+
45+
$resourceGroups | ForEach-Object -Parallel {
46+
$subscription = $using:subscription
47+
$subscriptionDetails = $using:subscriptionDetails
48+
Write-Host "Deleting resource group: $($_.name) in subscription: $subscription - $($subscriptionDetails.name)"
49+
az group delete --subscription $subscription --name $_.name --yes
50+
} -ThrottleLimit 10
51+
}
52+
} -ThrottleLimit 10
53+
54+
$managementGroups | ForEach-Object -Parallel {
55+
$managementGroupFilter = $using:managementGroupFilter
56+
$managementGroup = $_
57+
Write-Host "Processing management group: $managementGroup"
58+
59+
$managementGroupDetails = az account management-group show --name $managementGroup --expand | ConvertFrom-Json
60+
$childManagementGroups = $managementGroupDetails.children | Where-Object { $_.type -eq "Microsoft.Management/managementGroups" }
61+
if($managementGroupFilter -ne "") {
62+
$childManagementGroups = $childManagementGroups | Where-Object { $_.name -like "*$managementGroupFilter*" }
63+
}
64+
65+
$childManagementGroups | ForEach-Object -Parallel {
66+
$managementGroup = $using:managementGroup
67+
$childManagementGroup = $_
68+
Write-Host "Deleting management group: $($childManagementGroup.name) under parent: $managementGroup"
69+
az account management-group delete --name $childManagementGroup.name
70+
} -ThrottleLimit 10
71+
72+
$roleDefinitionsFilter = $using:roleDefinitionsFilter
73+
$subscriptions = $using:subscriptions
74+
$roleDefinitions = az role definition list --custom-role-only true --scope "/providers/Microsoft.Management/managementGroups/$managementGroup" --query "[].{name:name,roleName:roleName,id:id,assignableScopes:assignableScopes}" -o json | ConvertFrom-Json | Where-Object { $_.roleName -like "*$roleDefinitionsFilter*" -and $_.assignableScopes -contains "/providers/Microsoft.Management/managementGroups/$managementGroup" }
75+
$roleDefinitions | ForEach-Object -Parallel {
76+
$managementGroup = $using:managementGroup
77+
$roleDefinition = $_
78+
79+
$roleAssignments = az role assignment list --role $roleDefinition.name --scope "/providers/Microsoft.Management/managementGroups/$managementGroup" --query "[].{id:id,principalName:principalName,principalId:principalId}" -o json | ConvertFrom-Json
80+
$roleAssignments | ForEach-Object -Parallel {
81+
$managementGroup = $using:managementGroup
82+
$roleDefinition = $using:roleDefinition
83+
$roleAssignment = $_
84+
Write-Host "Deleting role assignment: $($roleAssignment.id) for role definition: $($roleDefinition.roleName) in management group: $managementGroup"
85+
az role assignment delete --ids $roleAssignment.id
86+
} -ThrottleLimit 10
87+
88+
foreach ($subscription in $using:subscriptions) {
89+
$subscriptionRoleAssignments = az role assignment list --role $roleDefinition.name --subscription $subscription --query "[].{id:id,principalName:principalName,principalId:principalId}" -o json | ConvertFrom-Json
90+
$subscriptionRoleAssignments | ForEach-Object -Parallel {
91+
$roleDefinition = $using:roleDefinition
92+
$subscription = $using:subscription
93+
$roleAssignment = $_
94+
Write-Host "Deleting role assignment: $($roleAssignment.id) for role definition: $($roleDefinition.roleName) in subscription: $subscription"
95+
az role assignment delete --ids $roleAssignment.id
96+
} -ThrottleLimit 10
97+
}
98+
99+
Write-Host "Deleting custom role definition: $($roleDefinition.roleName) in management group: $managementGroup"
100+
az role definition delete --name $roleDefinition.name --scope "/providers/Microsoft.Management/managementGroups/$managementGroup"
101+
102+
} -ThrottleLimit 10
103+
} -ThrottleLimit 10
104+
105+
Write-Host "Cleanup complete. :)"
Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
# This file can be used to clean up GitHub repositories if there has been an issue with the End to End tests.
22
# CAUTION: Make sure you are connected to the correct organization before running this script!
3-
$repos = gh repo list microsoft-azure-landing-zones-cd-tests --json name,owner | ConvertFrom-Json
3+
$filter = ""
44

5-
$repos | ForEach-Object -Parallel {
6-
$match = "*229*"
7-
$repoName = "$($_.owner.login)/$($_.name)"
8-
9-
if($repoName -like $match)
5+
$repos = @("")
6+
while ($repos.Count -gt 0) {
7+
$repos = gh repo list microsoft-azure-landing-zones-cd-tests --json name,owner | ConvertFrom-Json
8+
if($filter -ne "")
109
{
10+
$repos = $repos | Where-Object { $_.name -like "*$filter*" }
11+
}
12+
13+
$repos | ForEach-Object -Parallel {
14+
$repoName = "$($_.owner.login)/$($_.name)"
15+
1116
Write-Host "Deleting repo: $repoName"
1217
gh repo delete $repoName --yes
13-
14-
}
15-
} -ThrottleLimit 10
18+
} -ThrottleLimit 10
19+
}

.github/tests/cleanup-scripts/cleanup_resouce_groups.ps1

Lines changed: 0 additions & 9 deletions
This file was deleted.

.github/tests/scripts/azuredevops-pipeline-run.ps1

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,18 @@ function Invoke-Pipeline {
5050
}
5151

5252
if($iac -eq "bicep") {
53+
$pipelineDispatchBody = @{
54+
"resources" = @{
55+
"repositories" = @{
56+
"self" = @{
57+
"refName" = "refs/heads/main"
58+
}
59+
}
60+
}
61+
} | ConvertTo-Json -Depth 100
62+
}
63+
64+
if($iac -eq "bicep-classic") {
5365
$pipelineDispatchBody = @{
5466
"resources" = @{
5567
"repositories" = @{

0 commit comments

Comments
 (0)