Add handling to stress deploy script to tell users when they lack TME group permissions (#6502)

Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
This commit is contained in:
Azure SDK Bot 2025-04-03 14:02:13 -07:00 committed by GitHub
parent 6cc8fc195f
commit 292731bd66
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -48,7 +48,15 @@ function Login([string]$subscription, [string]$tenant, [string]$clusterGroup, [s
Write-Host "Logging in to subscription, cluster and container registry"
az account show -s "$subscription" *> $null
if ($LASTEXITCODE) {
RunOrExitOnFailure az login --allow-no-subscriptions --tenant $tenant
Run az login --allow-no-subscriptions --tenant $tenant
if ($LASTEXITCODE) {
throw "You do not have access to the TME subscription. Follow these steps to join the group: https://dev.azure.com/azure-sdk/internal/_wiki/wikis/internal.wiki/206/Subscription-and-Tenant-Usage?anchor=azure-sdk-test-resources-tme"
}
}
$subscriptions = (Run az account list -o json) | ConvertFrom-Json
if ($subscriptions.Length -eq 0) {
throw "You do not have access to the TME subscription. Follow these steps to join the group: https://dev.azure.com/azure-sdk/internal/_wiki/wikis/internal.wiki/206/Subscription-and-Tenant-Usage?anchor=azure-sdk-test-resources-tme"
}
# Discover cluster name, only one cluster per group is expected