0

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?

1 Answer 1

4

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