* Remove default sub config sub-config-azure-cloud-test-resources We no longer want to default the configuration and instead default from the service connection which had the info we need. * Fix quoting --------- Co-authored-by: Wes Haggard <Wes.Haggard@microsoft.com>
54 lines
1.8 KiB
YAML
54 lines
1.8 KiB
YAML
parameters:
|
|
- name: SubscriptionConfiguration
|
|
type: string
|
|
default: '{}'
|
|
- name: SubscriptionConfigurations
|
|
type: object
|
|
default: null
|
|
# EnvVars is used to help diagnose variable conflict issues early
|
|
- name: EnvVars
|
|
type: object
|
|
default: {}
|
|
- name: SubscriptionConfigurationFilePaths
|
|
type: object
|
|
default: null
|
|
|
|
steps:
|
|
- task: AzurePowerShell@5
|
|
displayName: Set Pipeline Subnet Info
|
|
condition: and(succeeded(), ne(variables['Pool'], ''))
|
|
env: ${{ parameters.EnvVars }}
|
|
inputs:
|
|
azureSubscription: azure-sdk-tests
|
|
azurePowerShellVersion: LatestVersion
|
|
pwsh: true
|
|
ScriptType: InlineScript
|
|
Inline: |
|
|
Set-AzContext 'Azure SDK Engineering System'
|
|
if ($env:Pool -eq 'Azure Pipelines') {
|
|
Write-Host "Skipping pool subnet lookup when running on an Azure Pipelines hosted pool"
|
|
Write-Host "##vso[task.setvariable variable=PoolSubnet;]"
|
|
exit 0
|
|
}
|
|
$poolSubnet = (Get-AzResource -ResourceGroupName azsdk-pools -Name $env:Pool -ExpandProperties).Properties.networkProfile.subnetId
|
|
Write-Host "Setting pipeline subnet env variable PoolSubnet to '$poolSubnet'"
|
|
Write-Host "##vso[task.setvariable variable=PoolSubnet;]$poolSubnet"
|
|
|
|
- pwsh: |
|
|
. ./eng/common/TestResources/SubConfig-Helpers.ps1
|
|
|
|
$baseSubConfigJson = @'
|
|
${{ parameters.SubscriptionConfiguration }}
|
|
'@.Trim()
|
|
|
|
$additionalSubConfigsJson = @'
|
|
${{ convertToJson(parameters.SubscriptionConfigurations) }}
|
|
'@.Trim() -replace '"{', '{' -replace '}"', '}'
|
|
|
|
$subConfigFilesJson = @'
|
|
${{ convertToJson(parameters.SubscriptionConfigurationFilePaths) }}
|
|
'@.Trim()
|
|
|
|
BuildAndSetSubscriptionConfig $baseSubConfigJson $additionalSubConfigsJson $subConfigFilesJson
|
|
displayName: Merge subscription configurations
|