Banty
Banty

Reputation: 971

Service account role for a Google Cloud Function that uploads data to BigQuery

I have a cloud function that reads files from Cloud Storage and uploads the data to BigQuery. I want to create a service account for this function to run under. What specific and appropriate roles should be given to the service account for the function to complete these operations?

Upvotes: 0

Views: 206

Answers (1)

Fony Lew
Fony Lew

Reputation: 534

Here are the roles you need for the service Account,

Read files from Cloud Storage:

  • Storage Object Viewer (assuming uniform permission bucket)

Write to BigQuery table:

  • BigQuery Data Editor

Also, make sure that it has the right permission at the dataset level. If you want the Cloud Function to be able to query, you might need to add BigQuery User permission.

Reference: Access Control with IAM | BigQuery

Upvotes: 4

Related Questions