> For the complete documentation index, see [llms.txt](https://docs.collibra.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.collibra.com/data-quality-self-hosted/connections/supported-connections/supported-jdbc-data-sources/connecting-to-google-bigquery/setting-up-cross-project-access-for-bigquery-datasets.md).

# Setting up cross-project access for BigQuery datasets

This page shows you how to make cross-account BigQuery datasets accessible to the GCP IAM service account in your project, and how to configure a BigQuery connection in Collibra DQ to run DQ checks against cross-account BigQuery datasets.

{% hint style="info" %}
In Pullup mode, BigQuery connections can only support one additional project.In Pushdown mode, BigQuery connections can support multiple additional projects. However, we do not recommend exceeding 3 additional projects.
{% endhint %}

The following diagram shows the architecture of cross-account access for BigQuery datasets. In this topic, Project A refers to the billing account in the panel on the left of this diagram, and Project B refers to the hosting account in the panel on the right.

![bigquery dataset cross-project access diagram](https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-47fb70b645108d3073c7237dcc9a21e633594bad%2Fdq-bigquery-dataset-cross-project-access.png?alt=media)

## Before you begin

* You have [created](/data-quality-self-hosted/connections/supported-connections/supported-jdbc-data-sources/connecting-to-google-bigquery.md) a BigQuery connection.

## Prerequisites

* You have a GCP IAM service account owned by Project A and its corresponding access JSON file.
* You have read access on BigQuery datasets hosted in Project B for the GCP service account owned by Project A.
  * You have at least roles/bigquery.dataViewer permissions on the BigQuery datasets.
* You have read and write access on the temporary dataset hosted by Project A for the GCP IAM service account.
  * You have at least roles/bigquery.jobUser and roles/bigquery.readSessionUser at the project level, and roles/bigquery.dataOwner permissions on the temporary dataset.
* The datasets of Project B and the temporary dataset of Project A are in the same zone.

## Steps

{% stepper %}
{% step %}
Sign in to Data Quality & Observability (self-hosted) and click <img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-268a786d787f353b92e094a60945df32bf9cb208%2FCogwheelIcon.svg?alt=media" alt="Cogwheel icon" data-size="line"> in the left navigation pane.
{% endstep %}

{% step %}
Click **Connections**.\ <i class="fa-chevrons-right">:chevrons-right:</i> The Connection Management page opens.
{% endstep %}

{% step %}
Locate your BigQuery connection, then click <img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-5face7f577747d86367bf6698315172b6a3536f5%2FEditIcon.svg?alt=media" alt="Edit icon" data-size="line">.\ <i class="fa-chevrons-right">:chevrons-right:</i> The Edit Connection modal appears.
{% endstep %}

{% step %}
Append the following properties to the **Connection URL**:

```
AdditionalProjects=project-b;QueryProperties=dataset_project_id=project-b
```

{% hint style="info" %}
Set the value of `project-b` according to your specific requirements.
{% endhint %}
{% endstep %}

{% step %}
Click the **Properties** tab.
{% endstep %}

{% step %}
Add the following **Driver Properties** to enable materialized view for optimized performance of the connector:

```
materializationProject=project-a;materializationDataset=temporary_dataset_name
```

{% hint style="info" %}
Set the values of `project-a` and the `temporary_dataset_name` according to your specific requirements.
{% endhint %}
{% endstep %}

{% step %}
Click **Submit**.
{% endstep %}

{% step %}
Click <img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-672bb2e060ed33b709b08eeed08bdfd3dad5812e%2Fcompass-icon.png?alt=media" alt="explorer icon" data-size="line"> **Explorer** and verify that the records in Explorer are the same as in your BigQuery connection.
{% endstep %}

{% step %}
When you create a new DQ Job, update the `-q` in the SQL Query editor with the following template query to identify the project:

```
-q "select * from project-b.dataset_name.table_name
```

{% hint style="info" %}
Set the values of `project-b`, `dataset_name`, and `table_name` according to your specific requirements.
{% endhint %}

{% hint style="danger" %}
If you do not update the query with these values, the default project is used and Collibra DQ may throw an error that it cannot find your cross-project dataset in the expected location.
{% endhint %}
{% endstep %}
{% endstepper %}
