Difference between revisions of "Gcloud auth list"

From wikieduonline
Jump to navigation Jump to search
Line 33: Line 33:
 
* <code>[[gcloud init]]</code>
 
* <code>[[gcloud init]]</code>
 
* <code>[[GOOGLE_APPLICATION_CREDENTIALS]]</code>
 
* <code>[[GOOGLE_APPLICATION_CREDENTIALS]]</code>
 +
* <code>[[gcloud auth application-default login]]</code>
  
 
== See also ==
 
== See also ==

Revision as of 08:07, 22 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`
gcloud auth list
                   Credentialed Accounts
ACTIVE  ACCOUNT
        your_user@you_account.iam.gserviceaccount.com
*       [email protected]

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: