gcloud auth application-default login and switch accounts

1,972 views
Skip to first unread message

E. S.

unread,
Sep 13, 2019, 9:12:02 AM9/13/19
to Google Cloud Developers
Hello,

Is it a best practice to always generate the application_default_credentials.json file every time switching GCP accounts?

I'm currently working on 2 GCP accounts one is for the company and the other is personal.

Thanks!
Erlou Miguel 

George (Cloud Platform Support)

unread,
Sep 18, 2019, 1:23:56 PM9/18/19
to google-c...@googlegroups.com
Hello Erlou, 

It would be easier to simply use incognito windows, one for the private account, the other for company. In such a scenario, there is no need to switch accounts all the time. If you use Chrome Browser, you can get an incognito window from the top-right three-dots window, or by using key combination Ctrl+Shift+N.  

If you work from Cloud SDKs command-line interface, you can create multiple project configurations using the "gcloud config configurations create" command. Once you create your new configuration, you can switch between configurations with gcloud config configurations activate. You may read more detail in various web tutorials, for instance Working with multiple environments in gcloud CLI
Reply all
Reply to author
Forward
0 new messages