File tree 2 files changed +8
-93
lines changed
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..."
10
10
SUBSCRIPTIONS=$( az account list --query " [?state=='Enabled'].{Name:name, ID:id}" --output tsv)
11
11
SUB_COUNT=$( echo " $SUBSCRIPTIONS " | wc -l)
12
12
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
14
17
# If only one subscription, automatically select it
15
18
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
16
23
echo " ✅ Using the only available subscription: $AZURE_SUBSCRIPTION_ID "
17
24
else
18
25
# If multiple subscriptions exist, prompt the user to choose one
You can’t perform that action at this time.
0 commit comments