Google Cloud Shell is using project=cloud-devshell-dev instead of my actual project, can't find enabled APIs
Asked Answered
H

1

4

I created a GCP project to play around with the video-intelligence API. I enabled the API on my project and launched a Cloud Shell.

I then copied the code from github and followed the README instructions.

However, when I try to run faces.py I get this error message:

StatusCode.PERMISSION_DENIED, Google Cloud Video Intelligence API has not been used in project cloud-devshell-dev before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/videointelligence.googleapis.com/overview?project=cloud-devshell-dev then retry

Why is it pointing to project=cloud-devshell-dev and not to my videointel project?

If I gcloud config list I can see the correct project and service account. Baffled.

Humbert answered 25/5, 2017 at 15:58 Comment(0)
D
6

Create a service account and have your application use it for API access, run:

  $ gcloud iam service-accounts create my-account
  $ gcloud iam service-accounts keys create key.json
    [email protected]
  $ export GOOGLE_APPLICATION_CREDENTIALS=key.json

In the second command replace my-project with your Project ID.

Dogoodism answered 26/5, 2017 at 3:5 Comment(1)
Thanks. This fixed the problem.Humbert

© 2022 - 2024 — McMap. All rights reserved.