File tree Expand file tree Collapse file tree 2 files changed +8
-93
lines changed Expand file tree Collapse file tree 2 files changed +8
-93
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -10,9 +10,16 @@ echo "🔄 Fetching available Azure subscriptions..."
1010SUBSCRIPTIONS=$( az account list --query " [?state=='Enabled'].{Name:name, ID:id}" --output tsv)
1111SUB_COUNT=$( echo " $SUBSCRIPTIONS " | wc -l)
1212
13- if [ " $SUB_COUNT " -eq 1 ]; then
13+ if [ " $SUB_COUNT " -eq 0 ]; then
14+ echo " ❌ ERROR: No active Azure subscriptions found. Please log in using 'az login' and ensure you have an active subscription."
15+ exit 1
16+ elif [ " $SUB_COUNT " -eq 1 ]; then
1417 # If only one subscription, automatically select it
1518 AZURE_SUBSCRIPTION_ID=$( echo " $SUBSCRIPTIONS " | awk ' {print $2}' )
19+ if [ -z " $AZURE_SUBSCRIPTION_ID " ]; then
20+ echo " ❌ ERROR: No active Azure subscriptions found. Please log in using 'az login' and ensure you have an active subscription."
21+ exit 1
22+ fi
1623 echo " ✅ Using the only available subscription: $AZURE_SUBSCRIPTION_ID "
1724else
1825 # If multiple subscriptions exist, prompt the user to choose one
You can’t perform that action at this time.
0 commit comments