> For the complete documentation index, see [llms.txt](https://docs.apono.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apono.io/docs/gcp-environment/gcp-integrations/bigquery.md).

# BigQuery

<div align="left"><figure><img src="/files/IL0KzeTr2TTkX9V6IQvc" alt=""><figcaption></figcaption></figure></div>

Google BigQuery is a fast, scalable, secure, fully managed data warehouse service in the cloud, serving as a primary data store for vast datasets and analytic workloads. Google Cloud enables businesses to analyze their data using standard SQL and existing business intelligence tools, promoting insightful decision-making and integration with various Google Cloud services.

Through this integration, Apono helps you securely manage access to your BigQuery datasets.

***

### Prerequisites

<table><thead><tr><th width="255">Item</th><th>Description</th></tr></thead><tbody><tr><td><strong>Apono Connector</strong></td><td>On-prem <a href="/pages/xPrzAcLGsoliEpPJuozp">connection</a> serving as a bridge between a Google Cloud instance and Apono</td></tr><tr><td><strong>Apono Premium</strong></td><td><a href="https://www.apono.io/pricing/">Apono plan</a> providing the most features and dedicated account support</td></tr><tr><td><strong>BigQuery Information</strong></td><td><a href="https://cloud.google.com/bigquery/docs/datasets">Dataset name</a> for the BigQuery datatset to be integrated</td></tr><tr><td><strong>Google Cloud Command Line Interface (Google Cloud CLI)</strong></td><td><a href="https://cloud.google.com/sdk/gcloud">Command-line interface</a> used to manage Google Cloud resources</td></tr><tr><td><strong>Google Cloud Information</strong></td><td><p>Information for your Google Cloud instance associated with the Apono connector<br><br><strong>Google-defined</strong>:</p><ul><li>(Organization) <a href="https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id">Organization ID</a></li><li><a href="https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects">Project ID</a></li></ul><p><strong>User-defined</strong></p><ul><li>Service Account Name</li></ul></td></tr></tbody></table>

***

### Associate BigQuery dataset permissions

To integrate BigQuery, you must create a custom role with BigQuery dataset permissions and assign the role to the service account for the Apono connector.

{% hint style="success" %}
The following instructions in this section use the Google Cloud CLI.

However, you can also [create a custom role](https://cloud.google.com/iam/docs/creating-custom-roles#creating) through the Google Console, and IAM client library, or the REST API. Additionally, you can [assign the custom role](https://cloud.google.com/iam/docs/granting-changing-revoking-access#iam-grant-single-role-console) to the Apono connector through the Google Console.
{% endhint %}

Follow these steps to associate the permissions through the Google Cloud CLI:

1. In your shell environment, log in to Google Cloud and enable the API.Shell

   ```shell
   gcloud auth login
   gcloud services enable cloudresourcemanager.googleapis.com
   gcloud services enable iam.googleapis.com
   ```
2. Set the environment variables.

{% tabs %}
{% tab title="Project" %}

```sh
export GCP_PROJECT_ID=<GOOGLE_PROJECT_ID>
export SERVICE_ACCOUNT_NAME=<SERVICE_ACCOUNT_NAME>
```

{% endtab %}

{% tab title="Organization" %}

```sh
export GCP_ORGANIZATION_ID=<GOOGLE_ORGANIZATION_ID>
export GCP_PROJECT_ID=<GOOGLE_PROJECT_ID>
export SERVICE_ACCOUNT_NAME=<SERVICE_ACCOUNT_NAME>
```

{% endtab %}
{% endtabs %}

3. Create the custom role. Be sure to replace the placeholders (`<ROLE_ID>`, `<TITLE>`, and `<DESCRIPTION>`) with actual values of your choosing for the role ID, title, and description of the role.ProjectOrganization

{% tabs %}
{% tab title="Project" %}
{% code overflow="wrap" %}

```sh
gcloud iam roles create <ROLE_ID> --project=$GCP_PROJECT_ID --title="<TITLE>" --description="<DESCRIPTION>" --permissions=bigquery.datasets.get,bigquery.datasets.update --stage=ALPHA
```

{% endcode %}
{% endtab %}

{% tab title="Organization" %}
{% code overflow="wrap" %}

```sh
gcloud iam roles create <ROLE_ID> --organization=$GCP_ORGANIZATION_ID --title="<TITLE>" --description="<DESCRIPTION>" --permissions=bigquery.datasets.get,bigquery.datasets.update --stage=ALPHA
```

{% endcode %}
{% endtab %}
{% endtabs %}

4. Using the role ID defined in the previous step, assign the custom role to the Apono connector service account.ProjectOrganization

{% tabs %}
{% tab title="Project" %}
{% code overflow="wrap" %}

```sh
gcloud projects add-iam-policy-binding $GCP_PROJECT_ID --member="serviceAccount:$SERVICE_ACCOUNT_NAME@$GCP_PROJECT_ID.iam.gserviceaccount.com" --role="projects/$GCP_PROJECT_ID/roles/<ROLD_ID>"
```

{% endcode %}
{% endtab %}

{% tab title="Organization" %}
{% code overflow="wrap" %}

```sh
gcloud organizations add-iam-policy-binding $GCP_ORGANIZATION_ID --member="serviceAccount:$SERVICE_ACCOUNT_NAME@$GCP_PROJECT_ID.iam.gserviceaccount.com" --role="organizations/$GCP_ORGANIZATION_ID/roles/<ROLE_ID>"
```

{% endcode %}
{% endtab %}
{% endtabs %}

***

### Integrate BigQuery

Follow these steps to complete the integration:

1. On the [**Catalog**](https://app.apono.io/catalog?search=google+bigquery) tab, click **Google BigQuery**. The **Connect Integration** page appears.
2. Under **Discovery**, click **Next**. The **Apono connector** section expands.
3. From the dropdown menu, select a connector.

{% hint style="success" %}
If the desired connector is not listed, click **+ Add new connector** and follow the instructions for creating a [GCP connector](/docs/gcp-environment/apono-connector-for-gcp.md).
{% endhint %}

4. Click **Next**. The **Integration Config** section expands.
5. Define the **Integration Config** settings.

   <table><thead><tr><th width="192">Setting</th><th>Description</th></tr></thead><tbody><tr><td><strong>Integration Name</strong></td><td>Unique, alphanumeric, user-friendly name used to identify this integration when constructing an access flow</td></tr><tr><td><strong>Project ID</strong></td><td>GCP project where BigQuery is enabled</td></tr><tr><td><strong>Dataset Name</strong></td><td>Name of the BigQuery dataset to integrate</td></tr></tbody></table>
6. Click **Next**. The **Custom Access Details** section expands.
7. Define the **Get more with Apono** settings.

   <table><thead><tr><th width="191">Setting</th><th>Description</th></tr></thead><tbody><tr><td><strong>Credential Rotation</strong></td><td>(Optional) Number of days after which the database credentials must be rotated<br><br>Learn more about the <a href="/pages/UsMtClaCM1SlvPsARUsM">Credentials Rotation Policy</a>.</td></tr><tr><td><strong>User cleanup after access is revoked (in days)</strong></td><td><p>(Optional) Defines the number of days after access has been revoked that the user should be deleted</p><p><br>Learn more about <a href="/pages/zJwQEG15iEhbPYg9hpqp">Periodic User Cleanup &#x26; Deletion</a>.</p></td></tr><tr><td><strong>Custom Access Details</strong></td><td>(Optional) Instructions explaining how to access this integration's resources<br><br>Upon accessing an integration, a message with these instructions will be displayed to end users in the User Portal. The message may include up to <strong>400 characters</strong>.<br><br>To view the message as it appears to end users, click <strong>Preview</strong>.</td></tr><tr><td><strong>Integration Owner</strong></td><td><p>(Optional) Fallback approver if no <a href="/pages/Ey4wuziyr2BzKYQnd5am">resource owner</a> is found<br><br>Follow these steps to define one or several integration owners:</p><ol><li>From the <strong>Attribute</strong> dropdown menu, select <strong>User</strong> or <strong>Group</strong> under the relevant identity provider (IdP) platform.</li><li>From the <strong>Value</strong> dropdown menu, select one or multiple users or groups.</li></ol><p><br><strong>NOTE</strong>: When <strong>Resource Owner</strong> is defined, an <strong>Integration Owner</strong> must be defined.</p></td></tr><tr><td><strong>Resource Owner</strong></td><td><p>(Optional) Group or role responsible for managing access approvals or rejections for the resource<br><br>Follow these steps to define one or several <a href="/pages/Ey4wuziyr2BzKYQnd5am">resource owners</a>:</p><ol><li>Enter a <strong>Key name</strong>. This value is the name of the tag created in your cloud environment.</li><li>From the <strong>Attribute</strong> dropdown menu, select an attribute under the IdP platform to which the key name is associated.<br><br>Apono will use the value associated with the key (tag) to identify the resource owner. When you update the membership of the group or role in your IdP platform, this change is also reflected in Apono.</li></ol><p><br><strong>NOTE</strong>: When this setting is defined, an <strong>Integration Owner</strong> must also be defined.</p></td></tr></tbody></table>
8. Click **Confirm**.

Now that you have completed this integration, you can [create access flows](/docs/access-flows/access-flows.md) that grant permission to your BigQuery datasets.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.apono.io/docs/gcp-environment/gcp-integrations/bigquery.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
