From 741c8cc157c4a24e9d5fcf8be1f0ca6f8a89e0bf Mon Sep 17 00:00:00 2001 From: Wes Haggard Date: Thu, 24 Oct 2024 09:24:03 -0700 Subject: [PATCH] Update to use TME subscription --- .azure-pipelines/test-eh-sb-sdk.yml | 31 ++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/.azure-pipelines/test-eh-sb-sdk.yml b/.azure-pipelines/test-eh-sb-sdk.yml index df0726a5..bfeef772 100644 --- a/.azure-pipelines/test-eh-sb-sdk.yml +++ b/.azure-pipelines/test-eh-sb-sdk.yml @@ -3,7 +3,7 @@ steps: displayName: 'Get variables if EventHub' condition: eq(variables['SDK'], 'EventHub') inputs: - azureSubscription: azure-sdk-tests + azureSubscription: azure-sdk-tests-public ScriptType: InlineScript azurePowerShellVersion: LatestVersion pwsh: true @@ -20,7 +20,7 @@ steps: displayName: 'Get variables if ServiceBus' condition: eq(variables['SDK'], 'ServiceBus') inputs: - azureSubscription: azure-sdk-tests + azureSubscription: azure-sdk-tests-public ScriptType: InlineScript azurePowerShellVersion: LatestVersion pwsh: true @@ -41,16 +41,29 @@ steps: - task: AzurePowerShell@5 inputs: workingDirectory: azure-sdk-for-python - azureSubscription: azure-sdk-tests + azureSubscription: azure-sdk-tests-public azurePowerShellVersion: LatestVersion pwsh: True ScriptType: InlineScript Inline: | eng/common/scripts/Import-AzModules.ps1 - $subscriptionConfiguration = @' - $(sub-config-azure-cloud-test-resources) - '@ | ConvertFrom-Json -AsHashtable; + $subscriptionConfiguration = @{} + + $context = Get-AzContext + $subscriptionConfiguration["Environment"] = $context.Environment.Name + $subscriptionConfiguration["SubscriptionId"] = $context.Subscription.Id + $subscriptionConfiguration["TenantId"] = $context.Subscription.TenantId + $subscriptionConfiguration["TestApplicationId"] = $context.Account.Id + $subscriptionConfiguration["ProvisionerApplicationId"] = $context.Account.Id + + $principal = Get-AzADServicePrincipal -ApplicationId $context.Account.Id + $subscriptionConfiguration["TestApplicationOid"] = $principal.Id + $subscriptionConfiguration["ProvisionerApplicationOid"] = $principal.Id + + Write-Host ($subscriptionConfiguration | ConvertTo-Json) + # Write the new SubscriptionConfiguration to be used by the remove test resources + Write-Host "##vso[task.setvariable variable=SubscriptionConfiguration;]$($subscriptionConfiguration | ConvertTo-Json -Compress)" eng/common/TestResources/New-TestResources.ps1 ` -ResourceType test ` @@ -88,7 +101,7 @@ steps: TEST_PYAMQP: 'false' PROXY_URL: 'http://localhost:5000' inputs: - azureSubscription: azure-sdk-tests + azureSubscription: azure-sdk-tests-public azurePowerShellVersion: LatestVersion pwsh: true ScriptType: InlineScript @@ -116,7 +129,7 @@ steps: - task: AzurePowerShell@5 inputs: workingDirectory: azure-sdk-for-python - azureSubscription: azure-sdk-tests + azureSubscription: azure-sdk-tests-public azurePowerShellVersion: LatestVersion pwsh: True ScriptType: InlineScript @@ -124,7 +137,7 @@ steps: eng/common/scripts/Import-AzModules.ps1 $subscriptionConfiguration = @' - $(sub-config-azure-cloud-test-resources) + $(SubscriptionConfiguration) '@ | ConvertFrom-Json -AsHashtable; eng/common/TestResources/Remove-TestResources.ps1 `