@@ -8,10 +8,11 @@ param (
88 [ValidatePattern (' ^[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$' )]
99 [string ] $TestApplicationId ,
1010
11- [Parameter ()]
12- [string ] $TestApplicationSecret ,
11+ [Parameter (Mandatory = $true )]
12+ [ValidateNotNullOrEmpty ()]
13+ [string ] $Environment ,
1314
14- [Parameter (ParameterSetName = ' Provisioner ' , Mandatory = $true )]
15+ [Parameter (Mandatory = $true )]
1516 [ValidateNotNullOrEmpty ()]
1617 [string ] $TenantId
1718)
@@ -23,9 +24,11 @@ $sshKey = Get-Content $PSScriptRoot/sshKey.pub
2324
2425$templateFileParameters [' sshPubKey' ] = $sshKey
2526
26- # Get the max version that is not preview and then get the name of the patch version with the max value
27+ az cloud set -- name $Environment
2728az login -- service- principal - u $TestApplicationId -- tenant $TenantId -- allow- no- subscriptions -- federated- token $env: ARM_OIDC_TOKEN
28- $versions = az aks get-versions - l westus - o json | ConvertFrom-Json
29+ # Get the max version that is not preview and then get the name of the patch version with the max value
30+ $region = if ($Environment -eq ' AzureUSGovernment' ) { ' usgovvirginia' } elseif ($Environment -eq ' AzureChinaCloud' ) { ' chinanorth3' } else { ' westus' }
31+ $versions = az aks get-versions - l $region - o json | ConvertFrom-Json
2932Write-Host " AKS versions: $ ( $versions | ConvertTo-Json - Depth 100 ) "
3033$patchVersions = $versions.values | Where-Object { $_.isPreview -eq $null } | Select-Object - ExpandProperty patchVersions
3134Write-Host " AKS patch versions: $ ( $patchVersions | ConvertTo-Json - Depth 100 ) "
@@ -61,4 +64,4 @@ Write-Host "##vso[task.setvariable variable=IDENTITY_SP_CERT_SNI;]$sniPath"
6164# Set for local
6265$env: IDENTITY_SP_CERT_PFX = $pfxPath
6366$env: IDENTITY_SP_CERT_PEM = $pemPath
64- $env: IDENTITY_SP_CERT_SNI = $sniPath
67+ $env: IDENTITY_SP_CERT_SNI = $sniPath
0 commit comments