---
url: 'https://docs.codatum.com/features/connection/warehouses/bigquery.md'
description: Setting up a BigQuery connection
---

# BigQuery

Connect Codatum to BigQuery to run SQL and manage data. For an overview of connections in general, see [Connection](../overview).

## Preparing BigQuery

Prepare a service account and service account key, and grant it the roles (or equivalent permissions) it needs on the target project and dataset.

| Grant on {.nowrap} | Role (or equivalent permission) |
| --- | --- |
| Project | `BigQuery Job User` (or `bigquery.jobs.create`) |
| Project | `BigQuery Read Session User` (or `bigquery.readsessions.create` / `getData` / `update`) |
| Dataset | `BigQuery Data Viewer` (or `bigquery.tables.getData` / `bigquery.datasets.get` / `bigquery.tables.get` / `bigquery.tables.list`) |

(Optional) To sync dataset and table information without entering a project ID, grant `resourcemanager.projects.get` on the target project.

Note the target **Project ID** for later use.

## Configuring Codatum

1. Open global nav > **Workspace settings** > **Data management** > **Connections**, then select **New connection**.
2. Select **Google BigQuery**.
3. Enter a **Connection name**.
4. Select an **Access level**.
5. Upload the service account key under **JSON key file** > **File upload** (Client Email is filled in automatically from the JSON).
6. Enter the **Project ID** (the JSON's `project_id` might be filled in as a default; you can change it manually).
7. Run **Test connect**, then save the connection.
8. On the sync targets screen shown after saving, select the datasets to sync ([Table metadata sync](../../catalog/metadata-sync#sync-target)). You can also skip this step.
