I'm currently trying to set up a service account to run a google cloud vision OCR sample but for some reason the print-access-token command keeps failing to find my key. I've completed the following steps 3 times already just to make sure I've followed the exact steps in the docs:
- Init gcloud SDK with project i had already created
- Enabled billing
- Create a JSON file containing key for service account with project owner as its role
set GOOGLE_APPLICATION_CREDENTIALS="C:\path\to\file\file.json"- run gcloud auth application-default print-access-token
I've also tried using gcloud auth application-default login just to be safe as it seemed to work for others who had different issues with print access token, but still no luck.
This is the error i receive from using print-access-token
ERROR: (gcloud.auth.application-default.print-access-token) File "C:\path\file.json" was not found.
I've tried running the the code samples regardless of this and receive the following exception:
Exception in thread "AWT-EventQueue-0" com.google.api.gax.rpc.PermissionDeniedException: io.grpc.StatusRuntimeException: PERMISSION_DENIED: Your application has authenticated using end user credentials from the Google Cloud SDK or Google Cloud Shell which are not supported by the vision.googleapis.com.
I haven't been able to find a solution anywhere. I understand it might be a stupid problem with an easy fix, but I'm really quite confused at the moment because I'm sure I've done everything fine so far. Thanks for any help in advance.