From 292731bd6605dece919a99a116babf30646f7191 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Thu, 3 Apr 2025 14:02:13 -0700 Subject: [PATCH] Add handling to stress deploy script to tell users when they lack TME group permissions (#6502) Co-authored-by: Ben Broderick Phillips --- .../stress-testing/stress-test-deployment-lib.ps1 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 b/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 index 3de02c1d7..a2ec15999 100644 --- a/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 +++ b/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 @@ -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