Difference between revisions of "Gcloud auth list"

From wikieduonline
Jump to navigation Jump to search
Line 10: Line 10:
 
  To set the active account, run:
 
  To set the active account, run:
 
     $ [[gcloud config set account]] `ACCOUNT`
 
     $ [[gcloud config set account]] `ACCOUNT`
 +
 +
 +
List active account:
 +
ACCOUNT=$(\
 +
  [[gcloud auth]] list \
 +
  --format="yaml" --filter="status=ACTIVE" \
 +
  --format="value(account)"\
 +
) && echo ${ACCOUNT}
  
  

Revision as of 20:20, 21 June 2022

https://cloud.google.com/sdk/gcloud/reference/auth/list

gcloud auth list
gcloud auth list
                   Credentialed Accounts
ACTIVE  ACCOUNT
*       your_user@you_account.iam.gserviceaccount.com

To set the active account, run:
    $ gcloud config set account `ACCOUNT`


List active account:

ACCOUNT=$(\
  gcloud auth list \
  --format="yaml" --filter="status=ACTIVE" \
  --format="value(account)"\
) && echo ${ACCOUNT}


Related

See also

Advertising: