Old Panda
Old Panda

Reputation: 1616

How to run gcloud command using given configuration of a service account

I have several gcloud service accounts and I'd like to add them to gcloud config configurations list. From what I could find on their doc, I could create different configurations using command gcloud config configurations create <config-name>. Then I did following to add a service account to my configuration list

gcloud config configurations activate <config-name>
gcloud config set account <service-account-email>
gcloud config configurations activate default

Seems like everything is fine. But when I try to deploy something it reports error

gcloud app deploy <some>.yaml --configurations <config-name>
ERROR: (gcloud.app.deploy) Your current active account [<service-account-email>] does not have any valid credentials

I have the credential file on hand but have no idea how to apply it. Any help would be appreciated.

Upvotes: 2

Views: 1550

Answers (1)

John Hanley
John Hanley

Reputation: 81346

You forgot to active your service account credentials:

gcloud auth activate-service-account [email protected] --key-file=service_account.json

Upvotes: 4

Related Questions