gcloud auth activate-service-account logout / revoke / remove / unset
Dec 10
In a gcloud CLI on a GCP Ubuntu VM, I added my service-account successfully using this command:
gcloud auth activate-service-account --key-file=mycredentialsialreadyhad.json
and now I can't remove or logout from it. I tried these commands and received errors:
gcloud auth revoke
ERROR: (gcloud.auth.revoke) Cannot revoke GCE-provided credentials.
gcloud config configurations delete default
ERROR: (gcloud.config.configurations.delete) Deleting named
configuration failed because configuration [default] is set as active.
Usegcloud config configurations activateto change the active
configuration.
1 answer
Accepted answer · original discussion
Dec 10
Use a command with a specified account because you can't revoke the Compute Engine service account(default).
For example:
gcloud auth revoke serviceaccount@testproject.iam.gserviceaccount.com
and run:
gcloud auth list
It should only display the default service account of the Compute Engine:
[PROJECT-NUMBER]-compute@developer.gserviceaccount.com
1 question comment
Use comments to ask for clarification. Post a solution as an answer.
Dec 11