some-name@some-project.iam.gserviceaccount.com
.🚧 Understanding the BigQuery User role The BigQuery User role is a predefined IAM role that allows for the creation of new datasets, with the creator granted BigQuery Data Owner on the new dataset. If you would like to avoid using the BigQuery User role, the minimum required permissions are:Note: These minimum permissions assume that the dataset has not been created ahead of time. If you create the dataset ahead of time, see the following note.
- On the Project level:
bigquery.datasets.create
bigquery.datasets.get
bigquery.jobs.create
🚧 Loading data into a Dataset that already exists By default, a new dataset (with a name you provide) will be created in the BigQuery project. If instead you create the dataset ahead of time, you will need to grant the BigQuery Data Owner role to this Service Account at the dataset level. In BigQuery, click on the existing dataset. In the dataset tab, click Sharing, then Permissions. Click Add Principals. Enter the Service Account name, and add the Role: BigQuery Data Owner Specifically, the minimum permissions required can be granted to the principal and applied to the Dataset:On the Project level, you will still need
bigquery.tables.create
bigquery.tables.delete
bigquery.tables.get
bigquery.tables.getData
bigquery.tables.list
bigquery.tables.update
bigquery.tables.updateData
bigquery.routines.get
bigquery.routines.list
bigquery.jobs.create
, but you will not needbigquery.datasets.create
orbigquery.datasets.get
.
🚧 Alternative authentication method: Granting direct access to service account Role based authentication is the preferred authentication mode for BigQuery based on GCP recommendations, however, providing a service account key to directly log-in to the created service account is an alternative authentication method that can be used if preferred.
- Back in the Service accounts menu, click the Actions dropdown next to the newly created service account and click Manage keys.
![]()
- Click Add key and then Create new key.
![]()
- Select the JSON Key type and click Create and make note of the key that is generated.
🚧 Choosing alocation
(region) The location you choose for your staging bucket must match the location of your destination dataset in BigQuery. When creating your bucket, be sure to choose a region in which BigQuery is supported (see BigQuery regions)
- If the dataset does not exist yet, the dataset will be created for you in the same region where you created your bucket.
- If the dataset does exist, the dataset region must match the location you choose for your bucket.