Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
3975fe6
Update readme
oZakari Nov 14, 2025
b3e0c09
Initial changes for local version of bicep-avm
oZakari Nov 14, 2025
8ec856b
Updates to deploy local
oZakari Nov 16, 2025
b91dcab
Add logic for networktype and subscription id replacment
oZakari Nov 16, 2025
3f22889
Adding subscription id replacement logic
oZakari Nov 17, 2025
f0279d5
Changes for new local config file for bicep-avm
oZakari Nov 21, 2025
bd47175
Final updates for local bicep-avm deployment
oZakari Nov 21, 2025
26fa1b1
Update error messaging
oZakari Nov 21, 2025
600fd62
All changes requird for working Github implementation for bicep-avm
oZakari Nov 21, 2025
b7f6612
Add support for firstwhatif deployment to github
oZakari Nov 24, 2025
ddb0bfd
Merge branch 'main' into add-accelerator-config
oZakari Nov 24, 2025
ecd4796
Initial azure devops files
oZakari Nov 24, 2025
300beaa
Merge branch 'add-accelerator-config' of https://github.com/Azure/acc…
oZakari Nov 24, 2025
3a47400
Align permissiosn with github
oZakari Nov 24, 2025
39ee3d7
Update permissions
oZakari Nov 24, 2025
c0d08eb
Add location replacement logic
oZakari Nov 24, 2025
9b13d14
simplify deployment stack names and replacment managment group id
oZakari Nov 25, 2025
02667dd
Update variable checks for network_type
oZakari Nov 25, 2025
42e460a
Update logic for first deployment
oZakari Nov 26, 2025
1d2c61b
Fix formatting
oZakari Nov 26, 2025
e92ac8b
Add lint bypass
oZakari Nov 26, 2025
153dacd
Add end-to-tests for bicep-avm
oZakari Nov 26, 2025
18dff73
Add logic to exit for both bicep and bicep avm scripts if error
oZakari Nov 26, 2025
4697177
Extend retry duration
oZakari Nov 26, 2025
31d0dd9
Add verbose logging
oZakari Nov 26, 2025
75a1c82
jared pedant changes
jaredfholgate Nov 26, 2025
19ea6ed
fixy mcfixington
jaredfholgate Nov 26, 2025
a3c0663
fix e2e test
jaredfholgate Nov 27, 2025
49c02fd
save changes
jaredfholgate Nov 27, 2025
e65c7d9
extract file manipulation and fix templating
jaredfholgate Nov 27, 2025
75f5d32
more fixes
jaredfholgate Nov 28, 2025
5a00eab
fixes for local
jaredfholgate Nov 28, 2025
23e908f
GitHub throttling
jaredfholgate Nov 28, 2025
b7cde44
fix tests
jaredfholgate Nov 28, 2025
f12a2c7
fix e2e tests
jaredfholgate Nov 28, 2025
82fb7fd
fixes
jaredfholgate Nov 28, 2025
8c9405a
i tests
jaredfholgate Nov 28, 2025
844eda1
fix bug
jaredfholgate Nov 28, 2025
901545d
fix tf local
jaredfholgate Nov 28, 2025
f6893cd
bug fix
jaredfholgate Nov 28, 2025
f43d2ad
fix templated files
jaredfholgate Nov 28, 2025
a6a45bb
reverse throttling
jaredfholgate Nov 28, 2025
3868f14
add option for debugging
jaredfholgate Nov 28, 2025
63de4b7
bug fix
jaredfholgate Nov 28, 2025
7970f5e
fix e2e tests
jaredfholgate Nov 28, 2025
b6b9629
soft fail PowerShell module upgrade
jaredfholgate Nov 28, 2025
c5af4b0
fix tests
jaredfholgate Nov 28, 2025
9605f8f
skip destory for avm bicep
jaredfholgate Nov 28, 2025
6446b0a
unique deployment name
jaredfholgate Nov 29, 2025
aec68a5
do not use runner groups in tests until we have a method to delete them
jaredfholgate Nov 29, 2025
ed61e6c
improve clean up jobs
jaredfholgate Nov 29, 2025
7d59ac0
loop cleanup
jaredfholgate Nov 29, 2025
c6012d7
add time stamp capability
jaredfholgate Nov 30, 2025
dabe61a
fix lin endings for linting
jaredfholgate Nov 30, 2025
e338ac9
linting
jaredfholgate Nov 30, 2025
3fa6979
linting
jaredfholgate Nov 30, 2025
470c931
fix typo
jaredfholgate Nov 30, 2025
952c025
engage brain
jaredfholgate Nov 30, 2025
3058f3a
fix date format
jaredfholgate Nov 30, 2025
8fd8efc
randomise location to ensure a retry on a location specific issue can…
jaredfholgate Nov 30, 2025
c59eed2
typo
jaredfholgate Nov 30, 2025
69fc0b7
simplify
jaredfholgate Nov 30, 2025
483abd0
remove canada
jaredfholgate Nov 30, 2025
63b0628
specify regions that have aci support and quota
jaredfholgate Nov 30, 2025
20f7264
fix regions list
jaredfholgate Nov 30, 2025
807387b
fix scripts
jaredfholgate Nov 30, 2025
6ed3f94
remove eastus
jaredfholgate Nov 30, 2025
c9b7401
Add nest MG test
jaredfholgate Dec 1, 2025
bb083a8
fix first run check
jaredfholgate Dec 1, 2025
22b6790
fix logic...
jaredfholgate Dec 1, 2025
3ef96de
improve clean up script
jaredfholgate Dec 1, 2025
2642a41
lookup sub
jaredfholgate Dec 1, 2025
f0304df
add provider no rbac for what if
jaredfholgate Dec 1, 2025
fccbb15
feat: update alz custom roles (#117)
jtracey93 Dec 1, 2025
395aa94
clean up MGs
jaredfholgate Dec 1, 2025
756e9e8
Merge branch 'add-accelerator-config' of https://github.com/Azure/acc…
jaredfholgate Dec 1, 2025
45f01ab
add check
jaredfholgate Dec 1, 2025
f6f2af9
trigger new run
jaredfholgate Dec 1, 2025
83ce5ad
fix what if perms
jaredfholgate Dec 1, 2025
ef170b0
fix type for ps argument
jaredfholgate Dec 1, 2025
f6a494b
add tenant role assignment for bicep
jaredfholgate Dec 1, 2025
3311349
fix local name
jaredfholgate Dec 1, 2025
8eba0ce
refactor: rename tenant role assignment variables for bicep compatibi…
jaredfholgate Dec 1, 2025
81b3fc0
docs and pipeline fixes
jaredfholgate Dec 1, 2025
d95bab9
trigger a new run
jaredfholgate Dec 1, 2025
a6605b5
try reverting role def
jaredfholgate Dec 2, 2025
e2d8e00
attempt to fix bootstrap perms issues
jaredfholgate Dec 2, 2025
85c92d0
fix bug
jaredfholgate Dec 2, 2025
9a5cf9c
revert variables
jaredfholgate Dec 2, 2025
ad36449
revert classic bicep perms
jaredfholgate Dec 2, 2025
dc9b786
clean role defs
jaredfholgate Dec 2, 2025
bd522a2
fix role def cleanup
jaredfholgate Dec 2, 2025
865a29c
typo
jaredfholgate Dec 2, 2025
b814529
Fix spacing
oZakari Dec 2, 2025
d5e3c7c
revert classic what if change
jaredfholgate Dec 2, 2025
85d1cf5
stupid mistake...
jaredfholgate Dec 2, 2025
05dc11f
fix linting
jaredfholgate Dec 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 6 additions & 71 deletions .config/ALZ-Powershell.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,84 +26,19 @@
"release_artifact_name": "starter_modules.zip",
"release_artifact_root_path": ".",
"release_artifact_config_file": ".config/ALZ-Powershell.config.json"

},
"bicep": {
"url": "https://github.com/Azure/alz-bicep-accelerator",
"release_artifact_name": "starter_modules.zip",
"release_artifact_root_path": ".",
"release_artifact_config_file": ".config/ALZ-Powershell.config.json"
},
"bicep-classic": {
"url": "https://github.com/Azure/ALZ-Bicep",
"release_artifact_name": "accelerator.zip",
"release_artifact_root_path": ".",
"release_artifact_config_file": "accelerator/.config/ALZ-Powershell-Auto.config.json"
}
}
},
"validators": {
"auth_scheme": {
"Type": "AllowedValues",
"Description": "A valid authentication scheme e.g. 'WorkloadIdentityFederation'",
"AllowedValues": {
"Display": true,
"Values": [
"WorkloadIdentityFederation",
"ManagedServiceIdentity"
]
}
},
"azure_subscription_id": {
"Type": "Valid",
"Description": "A valid subscription id GUID e.g. '12345678-1234-1234-1234-123456789012'",
"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}$"
},
"azure_name": {
"Type": "Valid",
"Description": "A valid Azure name e.g. 'my-azure-name'",
"Valid": "^[a-zA-Z0-9]{2,10}(-[a-zA-Z0-9]{2,10}){0,1}(-[a-zA-Z0-9]{2,10})?$"
},
"azure_name_section": {
"Type": "Valid",
"Description": "A valid Azure name with no hyphens and limited length e.g. 'abcd'",
"Valid": "^[a-zA-Z0-9]{2,10}$"
},
"guid": {
"Type": "Valid",
"Description": "A valid GUID e.g. '12345678-1234-1234-1234-123456789012'",
"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}$"
},
"cidr_range": {
"Type": "Valid",
"Description": "A valid CIDR range e.g '10.0.0.0/16'",
"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]))$"
},
"configuration_file_path": {
"Type": "Valid",
"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`",
"Valid": "^.+\\.(yaml|yml|json)$"
},
"network_type": {
"Type": "AllowedValues",
"Description": "Networking Type'",
"AllowedValues": {
"Display": true,
"Values": [
"hubNetworking",
"hubNetworkingMultiRegion",
"vwanConnectivity",
"vwanConnectivityMultiRegion",
"none"
]
}
},
"email": {
"Type": "Valid",
"Description": "A valid email address",
"Valid": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$"
},
"azure_location": {
"Type": "AllowedValues",
"Description": "An Azure deployment location e.g. 'uksouth'",
"AllowedValues": {
"Display": false,
"Values": [ "This is dynamically populated from Azure" ]
}
}
}
}
4 changes: 4 additions & 0 deletions .github/linters/.yaml-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ extends: default
ignore: |
**/bicep/**/ci-template.yaml
**/bicep/**/cd-template.yaml
**/bicep-classic/**/ci-template.yaml
**/bicep-classic/**/cd-template.yaml
*bicep-templates.yaml
**/bicep/**/cd.yaml
**/bicep-classic/**/cd.yaml
**/bicep-classic/**/ci.yaml

rules:
# 500 chars should be enough, but don't fail if a line is longer
Expand Down
105 changes: 105 additions & 0 deletions .github/tests/cleanup-scripts/cleanup_azure_resouces.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# This file can be used to clean up Resource Groups if there has been an issue with the End to End tests.
# CAUTION: Make sure you are connected to the correct subscription before running this script!
$managementGroupFilter = "alz-r"
if($managementGroupFilter -eq "")
{
throw "Please set a management group filter to avoid disaster!"
}
$subscriptionFilter = ""

$managementGroups = @(
"dac8feee-8768-4fbd-9cf9-9d96d4718018",
"alz-accelerator-parent-test"
)

$subscriptions = @(
"6be58818-3390-4c43-a3bb-2666110eeb66",
"5331601a-985a-4f45-87d1-6b4156c8acf5",
"bceedecb-9f0b-4aa3-9778-1d1fa92f289e",
"9ebf45b8-555d-49c6-81fb-d27ca08f7c28",
"eac9acf5-0a34-4db8-ae56-cdbcc7e2cf4c",
"3a6bdc35-0830-41ac-b323-37a5a030e241",
"c4332eb2-f966-47db-aa47-5d71e239d8aa",
"0aeefd1c-62c7-4071-91ad-925899603976",
"0d754f66-65b4-4f64-97f5-221f0174ad48"
)

$roleDefinitionsFilter = "Azure Landing Zones"

$subscriptions | ForEach-Object -Parallel {
$subscription = $_
$subscriptionDetails = az account show --subscription $subscription | ConvertFrom-Json
Write-Host "Processing subscription: $subscription - $($subscriptionDetails.name)"

$resourceGroups = @("")
while ($resourceGroups.Count -gt 0) {
if($subscriptionFilter -eq "")
{
$resourceGroups = az group list --subscription $subscription | ConvertFrom-Json
}
else
{
$resourceGroups = az group list --subscription $subscription --query "[?contains(name, '$subscriptionFilter')]" | ConvertFrom-Json
}

$resourceGroups | ForEach-Object -Parallel {
$subscription = $using:subscription
$subscriptionDetails = $using:subscriptionDetails
Write-Host "Deleting resource group: $($_.name) in subscription: $subscription - $($subscriptionDetails.name)"
az group delete --subscription $subscription --name $_.name --yes
} -ThrottleLimit 10
}
} -ThrottleLimit 10

$managementGroups | ForEach-Object -Parallel {
$managementGroupFilter = $using:managementGroupFilter
$managementGroup = $_
Write-Host "Processing management group: $managementGroup"

$managementGroupDetails = az account management-group show --name $managementGroup --expand | ConvertFrom-Json
$childManagementGroups = $managementGroupDetails.children | Where-Object { $_.type -eq "Microsoft.Management/managementGroups" }
if($managementGroupFilter -ne "") {
$childManagementGroups = $childManagementGroups | Where-Object { $_.name -like "*$managementGroupFilter*" }
}

$childManagementGroups | ForEach-Object -Parallel {
$managementGroup = $using:managementGroup
$childManagementGroup = $_
Write-Host "Deleting management group: $($childManagementGroup.name) under parent: $managementGroup"
az account management-group delete --name $childManagementGroup.name
} -ThrottleLimit 10

$roleDefinitionsFilter = $using:roleDefinitionsFilter
$subscriptions = $using:subscriptions
$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" }
$roleDefinitions | ForEach-Object -Parallel {
$managementGroup = $using:managementGroup
$roleDefinition = $_

$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
$roleAssignments | ForEach-Object -Parallel {
$managementGroup = $using:managementGroup
$roleDefinition = $using:roleDefinition
$roleAssignment = $_
Write-Host "Deleting role assignment: $($roleAssignment.id) for role definition: $($roleDefinition.roleName) in management group: $managementGroup"
az role assignment delete --ids $roleAssignment.id
} -ThrottleLimit 10

foreach ($subscription in $using:subscriptions) {
$subscriptionRoleAssignments = az role assignment list --role $roleDefinition.name --subscription $subscription --query "[].{id:id,principalName:principalName,principalId:principalId}" -o json | ConvertFrom-Json
$subscriptionRoleAssignments | ForEach-Object -Parallel {
$roleDefinition = $using:roleDefinition
$subscription = $using:subscription
$roleAssignment = $_
Write-Host "Deleting role assignment: $($roleAssignment.id) for role definition: $($roleDefinition.roleName) in subscription: $subscription"
az role assignment delete --ids $roleAssignment.id
} -ThrottleLimit 10
}

Write-Host "Deleting custom role definition: $($roleDefinition.roleName) in management group: $managementGroup"
az role definition delete --name $roleDefinition.name --scope "/providers/Microsoft.Management/managementGroups/$managementGroup"

} -ThrottleLimit 10
} -ThrottleLimit 10

Write-Host "Cleanup complete. :)"
22 changes: 13 additions & 9 deletions .github/tests/cleanup-scripts/cleanup_github-repositories.ps1
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
# This file can be used to clean up GitHub repositories if there has been an issue with the End to End tests.
# CAUTION: Make sure you are connected to the correct organization before running this script!
$repos = gh repo list microsoft-azure-landing-zones-cd-tests --json name,owner | ConvertFrom-Json
$filter = ""

$repos | ForEach-Object -Parallel {
$match = "*229*"
$repoName = "$($_.owner.login)/$($_.name)"

if($repoName -like $match)
$repos = @("")
while ($repos.Count -gt 0) {
$repos = gh repo list microsoft-azure-landing-zones-cd-tests --json name,owner | ConvertFrom-Json
if($filter -ne "")
{
$repos = $repos | Where-Object { $_.name -like "*$filter*" }
}

$repos | ForEach-Object -Parallel {
$repoName = "$($_.owner.login)/$($_.name)"

Write-Host "Deleting repo: $repoName"
gh repo delete $repoName --yes

}
} -ThrottleLimit 10
} -ThrottleLimit 10
}
9 changes: 0 additions & 9 deletions .github/tests/cleanup-scripts/cleanup_resouce_groups.ps1

This file was deleted.

12 changes: 12 additions & 0 deletions .github/tests/scripts/azuredevops-pipeline-run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,18 @@ function Invoke-Pipeline {
}

if($iac -eq "bicep") {
$pipelineDispatchBody = @{
"resources" = @{
"repositories" = @{
"self" = @{
"refName" = "refs/heads/main"
}
}
}
} | ConvertTo-Json -Depth 100
}

if($iac -eq "bicep-classic") {
$pipelineDispatchBody = @{
"resources" = @{
"repositories" = @{
Expand Down
Loading
Loading