4

I am struggling to make automated deployment using a service account work. First I created a new service account and now I am using a default %my-project-name%@appspot.gserviceaccount.com because presumably App Engine instances run under this account (am I understanding correctly?). I’ve never got a “permission denied” error but am always getting the “API not enabled” one. The very same command run as ordinary user works perfectly. I tried to give the service accounts all the permissions (including ”Project > Owner”) but result is still the same. What am I doing wrong? Is there a step-by-step guide somewhere on how to make automated App Engine deployments work? Can this be a result of misconfigured SDK on a CI machine?

Thank you.

Evgeny
  • 41
  • 3

2 Answers2

1

It looks like you just need to enable the App Engine API for your project as the error states:

You can use the gcloud command as described here:

gcloud config set project [YOUR_PROJECT_ID]
gcloud services enable appengine.googleapis.com

Or you can do it from the Cloud Console:

  • Look for the APIs and Services menu and click the “Library” options. enter image description here
  • In The search bar type: “App Engine Admin API”.

  • Click on the result and then click the enable button. enter image description here

Hope this helps.

ch_mike
  • 146
  • 2
  • Hello! Enormous thanks for your answer! I was puzzled at first on how an API could be enabled for “ordinary” account but disabled for a service account. However your answer made me want to experiment with the command you provided (`gcloud services enable…`). That gave me the message that I have to enable the Service Usage API. I am still not sure what is the logic behind that and why it seeming is not mentioned in Googles guides about CI deployments. After I enabled the Service Usage API, I removed the `gcloud services enable…` line. And now things work without it. – Evgeny Sep 28 '18 at 08:13
  • I see, because the Service Usage API was disabled, GCP wasn't able to see the available Services, thus, the error referencing another API. It is unclear to me though, why this API was disabled for your project. Anyway, I'm glad you could get to the bottom of this. – ch_mike Sep 28 '18 at 13:48
0

So with the helpful answer by ch_mike I found that for me the solution was to enable Service Usage API:

https://console.developers.google.com/apis/api/serviceusage.googleapis.com/landing?project=my-project-name

Evgeny
  • 41
  • 3