How to set GOOGLE_APPLICATION_CREDENTIALS for Google Compute Engine?

前端 未结 3 734
难免孤独
难免孤独 2021-01-18 00:31

I have Google Compute Engine\'s Credentials file , renamed as key.json. The next step is to set the environment variable with name GOOGLE_APPLICATION_CREDENTIALS. But it say

3条回答
  •  花落未央
    2021-01-18 01:02

    You got the error because you downloaded an OAuth 2.0 Client ID instead of a Service Account key.

    If you want to use regular user credentials as the application default, you can now use the gcloud beta auth application-default login command to launch the web sign-in flow. This puts them in the well-known location for application default credentials, so you should unset the GOOGLE_APPLICATION_CREDENTIALS variable if you use this method.

提交回复
热议问题