0

I'm trying to query from BigQuery using PowerShell. I've initialised gcloud init and logged in to my account.
The request was this:

bq query --use_legacy_sql=false 'SELECT customer_id FROM `demo1.customers1`'

Resulting with this error:

BigQuery error in query operation: Error processing job
'PROJECT-ID:bqjob': Access Denied:
BigQuery BigQuery: Permission denied while getting Drive credentials.

This worked when I run it in cloud shell.

I've created a service account before and a key for the project. I tried to run this command and doesn't solve it:

gcloud auth activate-service-account [email protected] --key-file=D:/folder/key.json --project=MYPROJECT_ID
10
  • Does the service account has BigQuery permission? Commented Sep 2, 2022 at 2:38
  • Yes. I set it as the owner Commented Sep 2, 2022 at 2:40
  • Could you please try bq ls. Just ensure that this account able to access BigQuery. Commented Sep 2, 2022 at 2:44
  • Sure. It shows the datasetId Commented Sep 2, 2022 at 2:51
  • 1
    Can you try this command “gcloud auth login --enable-gdrive-access”? Let me know if it's helpful or not? Commented Sep 2, 2022 at 7:38

1 Answer 1

1

Service account should have the OAuth scope for Drive to access drive, below command can be used to authenticate with Drive.

gcloud auth login --enable-gdrive-access
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.