0
votes

I have a python program executing bigquery using cloud service account successfully. When I try to schedule the python program using Jenkins, I see the below error The gcloud user has bigquery editor, dataowner and admin permission to table, and dataset.

Log: gcloud auth activate-service-account abc --key-file=**** Activated service account credentials for: abc273721.iam.gserviceaccount.com] gcloud config set project p1 Updated property p1. 403 Access Denied: Table XYZ: User does not have permission to query table

2
Double check the service account has the correct IAM first. Also, is the query that it's running trying to access a table in another project by any chance?Graham Polley

2 Answers

0
votes

I see that you have provided all the required roles; bigquery.dataOwner & bigquery.admin,as mentioned here but it looks like you have to also grant the service account access to the dataset.

0
votes

Create a service account with BigQuery Admin Role and download JSON key file (example: data-lab.json). Use below code:

gcloud auth activate-service-account "service-account" --key-file=data-lab.json --project="project-name"