Merge pull request #6087 from delgod/multiple-azure-accounts

handle multiple Azure accounts correctly
This commit is contained in:
Christopher Boumenot 2018-03-30 10:45:20 -07:00 committed by GitHub
commit 2f18f24325
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -85,9 +85,9 @@ askSubscription() {
if [ "$azure_subscription_id" != "" ]; then if [ "$azure_subscription_id" != "" ]; then
az account set --subscription $azure_subscription_id az account set --subscription $azure_subscription_id
else else
azure_subscription_id=$(az account list | jq -r .[].id) azure_subscription_id=$(az account list | jq -r '.[] | select(.isDefault==true) | .id')
fi fi
azure_tenant_id=$(az account list | jq -r '.[] | select(.tenantId) | .tenantId') azure_tenant_id=$(az account list | jq -r '.[] | select(.id=="'$azure_subscription_id'") | .tenantId')
echo "Using subscription_id: $azure_subscription_id" echo "Using subscription_id: $azure_subscription_id"
echo "Using tenant_id: $azure_tenant_id" echo "Using tenant_id: $azure_tenant_id"
} }