Data Export to BigQuery: permissions step by step
How to create a BigQuery dataset and grant AdShift the two roles it needs, so exported data lands in your warehouse without giving us a credential.
BigQuery is the destination where AdShift never holds a credential of yours. You grant our service account access to one dataset; we load data into it. Removing us later is an IAM change on your side.
This article is the permissions walkthrough. For what gets exported and on what schedule, see Data Export.
What you need
- A GCP project where you can grant IAM roles (the Owner or IAM Admin role on it).
- AdShift's service account address. The connection screen shows it when you pick BigQuery; it looks like
adshift-data-export@adshift-data-export.iam.gserviceaccount.com. - About five minutes.
1. Create a dedicated dataset
Use a dataset only for AdShift data. Mixing it with tables your own jobs write makes the two hard to tell apart, and exported tables are replaced partition by partition.
In the Cloud Console: BigQuery → your project → Create dataset. Name it something like adshift_export and pick a location.
The location matters. BigQuery cannot load data across locations, and it cannot move a dataset afterwards — a dataset in the wrong region has to be recreated. Pick the region your other data lives in, usually EU or US.
2. Grant BigQuery Data Editor on the dataset
This lets AdShift create and replace tables inside that dataset — and nothing outside it.
- In BigQuery, select the dataset.
- Click Sharing → Permissions.
- Click Add principal.
- Paste the AdShift service account address.
- Choose the role BigQuery → BigQuery Data Editor.
- Click Save.
Grant this on the dataset, not the project. A project-level grant works too, but it gives AdShift access to every dataset you own — more than the export needs, and the first thing a security review flags.
3. Grant BigQuery Job User on the project
This lets AdShift start a load job at all. It has to be project-level, because in BigQuery a job is a project-level resource.
- Open IAM & Admin → IAM.
- Click Grant access.
- Paste the same service account address.
- Choose the role BigQuery → BigQuery Job User.
- Click Save.
This role grants no access to data on its own. A job can only touch datasets the caller already has data access to — which is the single dataset from step 2.
4. Connect it in AdShift
Go to Data Export → Connections → New connection, pick BigQuery and fill in:
| Field | What to enter |
|---|---|
| Connection name | Lowercase letters, digits and hyphens, e.g. bigquery-marketing |
| GCP project ID | The project that owns the dataset |
| BigQuery dataset name | adshift_export — letters, digits and underscores only |
| Dataset location | The location you picked in step 1, e.g. EU |
Click Test connection. Four checks run: the dataset is visible, its location matches, a dry-run load job succeeds (which proves Job User), and the dataset accepts table creation (which proves Data Editor). Each check is shown separately, so a failure tells you which grant is missing.
Then click Save, open Reports on the connection, and pick your datasets.
What you get in BigQuery
Each exported dataset becomes one date-partitioned table. Data arrives typed — timestamps as TIMESTAMP, revenue as NUMERIC — so no JSON parsing is needed.
Because tables are partitioned by date and a partition is loaded into its matching table partition, a re-delivery after late data replaces that day's rows instead of duplicating them. You do not need to deduplicate.
Loading data into BigQuery is free. You pay for storage and for the queries you run, so export only the datasets and fields you use, and filter by date in your queries.
If something goes wrong
"Not found: Dataset …" — the project ID or dataset name is wrong, or Data Editor was granted on a different dataset. Dataset names are case-sensitive.
"Permission bigquery.jobs.create denied" — the BigQuery Job User role is missing on the project. It cannot be granted at dataset level, so this one is easy to skip by accident.
"Cannot read and write in different locations" — the location in AdShift does not match the dataset's. Correct the value in the connection; if the dataset itself is in the wrong region, recreate it.
Tables appear but stay empty — check the report's filters, and look for Skipped runs in the delivery history, which mean the partition had no rows after filtering.
Revoking access
Disable or delete the connection in AdShift first, then remove the two IAM bindings. Removing the bindings while the connection is still active just makes the next delivery fail with a permission error. Data already loaded is in your project and is unaffected either way.
See also
- Data Export — datasets, schedule, delivery history
- Data Export to Google Cloud Storage — the same data as files, when a table is not what you want
Data Export to Azure Blob Storage: setup step by step
How to create a container, issue a SAS token with the four permissions a delivery needs, and connect it in AdShift.
Data Export to Google Cloud Storage: permissions step by step
How to prepare a GCS bucket and issue a service-account key scoped to it, so exported partitions land in your own storage.