Skip to content

Commit 13705e7

Browse files
authored
Merge branch 'main' into avm-bicep
2 parents 12ac0b7 + cd972db commit 13705e7

File tree

5 files changed

+1223
-8
lines changed

5 files changed

+1223
-8
lines changed

src/ALZ.build.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Enter-Build {
9292
$script:BuildModuleRootFile = Join-Path -Path $script:ModuleSourcePath -ChildPath "$($script:ModuleName).psm1"
9393

9494
# Ensure our builds fail until if below a minimum defined code test coverage threshold
95-
$script:coverageThreshold = 30
95+
$script:coverageThreshold = 5
9696

9797
[version]$script:MinPesterVersion = '5.2.2'
9898
[version]$script:MaxPesterVersion = '5.99.99'

src/ALZ/ALZ.psd1

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,17 @@
3030
Copyright = '(c) Microsoft Corporation. All rights reserved.'
3131

3232
# Description of the functionality provided by this module
33-
Description = 'Azure Landing Zones Powershell Module'
33+
Description = @'
34+
Azure Landing Zones Powershell Module
35+
36+
This module provides cmdlets to help deploy and manage Azure Landing Zones (ALZ) in your Azure environment.
37+
38+
Included Cmdlets:
39+
- Test-AcceleratorRequirement: Tests if the current environment meets the requirements for deploying ALZ.
40+
- Deploy-Accelerator: Deploys the Azure Landing Zone accelerator to your Azure subscription.
41+
- Grant-SubscriptionCreatorRole: Grants the Subscription Creator role to a specified user or service principal.
42+
- Remove-PlatformLandingZone: Removes the deployed Azure Landing Zone from your Azure subscription
43+
'@
3444

3545
CompatiblePSEditions = 'Core'
3646

@@ -74,7 +84,8 @@
7484
FunctionsToExport = @(
7585
'Test-AcceleratorRequirement',
7686
'Deploy-Accelerator',
77-
'Grant-SubscriptionCreatorRole'
87+
'Grant-SubscriptionCreatorRole',
88+
'Remove-PlatformLandingZone'
7889
)
7990

8091
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.

src/ALZ/Private/Tools/Test-Tooling.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,15 +160,16 @@ function Test-Tooling {
160160
} else {
161161
# Check if latest ALZ module is installed
162162
Write-Verbose "Checking ALZ module version"
163-
$alzModuleCurrentVersion = Get-InstalledModule -Name ALZ -ErrorAction SilentlyContinue
163+
$alzModuleCurrentVersion = Get-InstalledPSResource -Name ALZ | Select-Object -Property Name, Version
164+
164165
if($null -eq $alzModuleCurrentVersion) {
165166
$checkResults += @{
166167
message = "ALZ module is not correctly installed. Please install the latest version using 'Install-Module ALZ'."
167168
result = "Failure"
168169
}
169170
$hasFailure = $true
170171
}
171-
$alzModuleLatestVersion = Find-Module -Name ALZ
172+
$alzModuleLatestVersion = Find-PSResource -Name ALZ
172173
if ($null -ne $alzModuleCurrentVersion) {
173174
if ($alzModuleCurrentVersion.Version -lt $alzModuleLatestVersion.Version) {
174175
$checkResults += @{

src/ALZ/Public/Grant-SubscriptionCreatorRole.ps1

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,9 @@ Grant-SubscriptionCreatorRole -servicePrincipalObjectId "bd42568a-7dd8-489b-bbbb
132132
"principalTenantId" = $tenantId
133133
}
134134
}
135-
$roleAssignmentPayloadJson = $roleAssignmentHashTable | ConvertTo-Json -Depth 100 -Compress
136-
$roleAssignmentPayloadJson = $roleAssignmentPayloadJson -replace '"', '\"'
135+
$roleAssignmentPayloadJson = $roleAssignmentHashTable | ConvertTo-Json -Depth 100
137136

138-
$grantRbac = $(az rest --method PUT --url "$managementApiPrefix$($billingResourceID)/billingRoleAssignments/$($roleAssignmentName)?api-version=2024-04-01" --body $roleAssignmentPayloadJson) | ConvertFrom-Json
137+
$grantRbac = $(az rest --method PUT --url "$managementApiPrefix$($billingResourceID)/billingRoleAssignments/$($roleAssignmentName)?api-version=2024-04-01" --body "$roleAssignmentPayloadJson") | ConvertFrom-Json
139138

140139
if ($null -eq $grantRbac) {
141140
$errorMessage = "The 'SubscriptionCreator' role could not be granted to the service principal. Please check the error message above and try again."

0 commit comments

Comments
 (0)