How to run gcloud command line using a service account

  1. Create a service account with GCP console
  2. Download the json key file
  3. Create a role and assign proper required permissions to the role.
  4. gcloud config set account gcli@someproject.iam.gserviceaccount.com
  5. gcloud auth activate-service-account — key-file=gcli.json — project=someprojectname

--

--

I just get things done

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store