If I have multiple projects how do I specify which one gets used by default?

With gcloud I see that I have a project active in the "default configuration" but when I run my local software that is interacting with the Compute Engine API a different project gets used (as shown via the web console).


Specifying a Project from your local clients depend upon the authentication process. You can find some examples [1] [2] in the documentation, according to what client are you using, for setting the Project.

  • Hi. LIke I said, I am authenticated via gcloud. Now I want to use my own tool. This tool only worked when I associated a service account with a GCP Project, turned on billing, linked billing to the Project, enabled the Compute Engine API, and assigned a few roles to the service account. It works. But then I got to think about how I could create a second Project and apply the tool to it. How do I associate my tool to a project? – pmatulis Sep 8 '18 at 0:22
  • Just to clarify, when you mention "tool", do you mean a software done by you that is using the Client Libraries? – Neri Sep 10 '18 at 19:20

So I neglected to appreciate that the service agent is actually contained within the project. That's the piece I was missing. It all makes sense now and testing confirmed my understanding.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.