gcloud always uses default credentials

I ran into trouble with gcloud credentials. It always uses default user credentials even when I add new credentials with gcloud auth activate-service-account --key-file=[PATH]. When I list my credentials with gcloud auth list, I can see active credentials which I added earlier.

What am I doing wrong? Are there any troubles with gcloud on Linux (my OS)?

Upvotes: 1

Views: 1372

Answers (1)

JC98
JC98

Reputation: 624

When you list the accounts that are configured by using gcloud auth list you should see the service account added. If it is not set as active (with * ) then you can select it by using gcloud config set account YOUR_SERV_ACC. There are no problems with gcloud on Linux, you probably also need to revoke previously generated Application Default Credentials : gcloud auth application-default revoke.

Upvotes: 2

Related Questions