Skip to content

Commit b41d8e7

Browse files
azure-sdkbenbp
andauthored
Add handling to stress deploy script to tell users when they lack TME group permissions (#40344)
Co-authored-by: Ben Broderick Phillips <[email protected]>
1 parent ddd7941 commit b41d8e7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1

+9-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,15 @@ function Login([string]$subscription, [string]$tenant, [string]$clusterGroup, [s
4848
Write-Host "Logging in to subscription, cluster and container registry"
4949
az account show -s "$subscription" *> $null
5050
if ($LASTEXITCODE) {
51-
RunOrExitOnFailure az login --allow-no-subscriptions --tenant $tenant
51+
Run az login --allow-no-subscriptions --tenant $tenant
52+
if ($LASTEXITCODE) {
53+
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"
54+
}
55+
}
56+
57+
$subscriptions = (Run az account list -o json) | ConvertFrom-Json
58+
if ($subscriptions.Length -eq 0) {
59+
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"
5260
}
5361

5462
# Discover cluster name, only one cluster per group is expected

0 commit comments

Comments
 (0)