Moty Michaely
Moty Michaely

Reputation: 23

BigQuery authorization

I am trying to use the bq command line tool to load data into BigQuery from GCS bucket and I receive the following error message:

BigQuery error in load operation: Access Denied: Job mythical-maxim-293:bqjob_r11765e0cd9ceb52b_000001427694f0e1_1: RUN_JOB

I was using service account (with private key) for authentication. I followed the following links for granting the service account access level:

https://developers.google.com/bigquery/loading-data-into-bigquery https://developers.google.com/bigquery/access-control

The service account email was granted WRITE access with the BigQuery dataset and READ access with the GCS bucket.

Note: Adding the service account email as a writer to the project, solved the issue but this is not feasible for my case. I am not allowed to request project level write access but BigQuery and GCS (readonly).

Thanks!

Upvotes: 1

Views: 4281

Answers (2)

Deepak Mittal
Deepak Mittal

Reputation: 199

You must provide the WRITE permission on the dataset.

https://cloud.google.com/bigquery/loading-data-into-bigquery#access

This is bad, as WRITE permission imply that you have READ permission. But, for bigquery READ is paid and Load is free. For doing free task, access to paid service should be necessary.

Google must correct this.

Upvotes: 0

Jordan Tigani
Jordan Tigani

Reputation: 26617

In order to run the job, the service account must be given at least READ permissions on the project. This is because whoever runs a job in the project can do things that cost the project owner money (e.g. run queries).

To add the service account to the project, go to https://cloud.google.com/console, then click on "Permissions", then "Add member".

Upvotes: 4

Related Questions