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

# BigQuery

Establishing a workspace connection to a BigQuery data warehouse allows any workflow in that workspace to access tables from datasets in BigQuery.

To establish a connection to your BigQuery data warehouse, click the **Integrations** tab in your workspace and select **New Integration.**&#x20;

When establishing a connection, the following information is required:

| Input           | Description                                    |
| --------------- | ---------------------------------------------- |
| Connection Name | Choose a name for your connection              |
| Key             | Service account key file generated by BigQuery |

{% hint style="info" %}
Importing data uses the BigQuery Storage API, which must be enabled on your Google Cloud Platform account.
{% endhint %}

## **Database configuration instructions**

To connect Cascade to your BigQuery project, you will need to create a service account for Cascade to use.

### Generate a new BigQuery service account key

You must have Google Cloud admin permissions to create a service account. Google has documentation on creating a [service account](https://cloud.google.com/iam/docs/service-accounts) and [generating a service account key](https://cloud.google.com/storage/docs/authentication#generating-a-private-key).

1. Navigate to the [Google Developers Console](https://console.developers.google.com/). Before proceeding, click on the drop down to the left of the search bar and select the project to which you want to connect. Once selected, choose **Credentials** in the left menu:\ <img src="https://2577551913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MW_FvcY52Jcyt8JHFGs%2Fuploads%2FvcD7nNL6apJD4hEw6Suz%2FCredentials_%E2%80%93_APIs___Services_%E2%80%93_My_First_Project_%E2%80%93_Google_Cloud_Platform-2.png?alt=media&amp;token=58c92954-73b9-46ee-9e62-be16b2ee151d" alt="" data-size="original">
2. Click **CREATE CREDENTIALS** and choose **Service account**:\
   ![](https://2577551913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MW_FvcY52Jcyt8JHFGs%2Fuploads%2FRaI19yVUwZCbsdhsJkHr%2FCredentials_%E2%80%93_APIs___Services_%E2%80%93_My_First_Project_%E2%80%93_Google_Cloud_Platform.png?alt=media\&token=dd8024e6-2908-473e-8d95-c819e8864a95)
3. Enter a name for the new service account, optionally add a description, and click **CREATE**:\
   ![](https://2577551913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MW_FvcY52Jcyt8JHFGs%2Fuploads%2FTpEBOlhKa4RYjN01ugPe%2FCreate_service_account_%E2%80%93_IAM___Admin_%E2%80%93_My_First_Project_%E2%80%93_Google_Cloud_Platform_and_SJB224RVH_pdf.png?alt=media\&token=a035f0aa-652f-4695-b12d-bd402e17a5d5)
4. Your service account requires two Google BigQuery [predefined roles](https://cloud.google.com/bigquery/access-control#curated_roles_comparison_matrix):

   * **BigQuery > BigQuery Data Editor**
   * **BigQuery > BigQuery Job User**

   Select the first role in the **Select a role** field, then click **ADD ANOTHER ROLE** and select the second role.

   After selecting both roles, click **CONTINUE**:\
   ![](https://2577551913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MW_FvcY52Jcyt8JHFGs%2Fuploads%2F85OKhH9ZG7dxfNM0edyp%2FCreate_service_account_%E2%80%93_IAM___Admin_%E2%80%93_My_First_Project_%E2%80%93_Google_Cloud_Platform-2.png?alt=media\&token=ca6829c4-f1ef-4fdd-9f34-1e0b4bd96294)
5. Click **Done**:\
   ![](https://2577551913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MW_FvcY52Jcyt8JHFGs%2Fuploads%2Fswl7gPkgEobWJmswgoGM%2FCreate_service_account_%E2%80%93_IAM___Admin_%E2%80%93_My_First_Project_%E2%80%93_Google_Cloud_Platform.png?alt=media\&token=823f873a-6943-4ad4-9076-b39a83f843c7)
6. This will create your service account, which needs a key to access. Select the service account you just created, then click **KEYS**, then **Add Key:**\
   ![](https://2577551913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MW_FvcY52Jcyt8JHFGs%2Fuploads%2FrTJxd2NBkfYRFesPceeD%2FService_accounts_%E2%80%93_IAM___Admin_%E2%80%93_My_First_Project_%E2%80%93_Google_Cloud_Platform.png?alt=media\&token=f179a3aa-93cc-4d02-9430-f96c6d38e2a6)\
   ![](https://2577551913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MW_FvcY52Jcyt8JHFGs%2Fuploads%2FTj1Wi3tN7z5z60ISJXfj%2FCascade_service_account_%E2%80%93_IAM___Admin_%E2%80%93_My_First_Project_%E2%80%93_Google_Cloud_Platform.png?alt=media\&token=1f58514b-d168-4d3b-be02-1390cd3de52c)
7. Select **JSON** and click **CREATE**:\
   ![](https://2577551913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MW_FvcY52Jcyt8JHFGs%2Fuploads%2FdaQTdOqqs8hJf6azDIcP%2FCascade_service_account_%E2%80%93_IAM___Admin_%E2%80%93_My_First_Project_%E2%80%93_Google_Cloud_Platform-2.png?alt=media\&token=3e2182a7-93a6-4f08-bcd9-61d7ea7aa7e9)
8. The JSON key will be saved to your computer. **BE SURE TO REMEMBER WHERE IT IS SAVED.** After noting the download location, click **CLOSE**:\
   ![](https://2577551913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MW_FvcY52Jcyt8JHFGs%2Fuploads%2FZx5UnYvPsYaqyXOq1VsK%2FCascade_service_account_%E2%80%93_IAM___Admin_%E2%80%93_My_First_Project_%E2%80%93_Google_Cloud_Platform-3.png?alt=media\&token=d5eab061-42bb-4e17-9f52-81185d99cccf)

### Use your key to connect BigQuery to Cascade

1. Return to Cascade, and begin the process to connect a BigQuery database. When you see the form to enter your BigQuery credentials, first enter a name for the new database connection.
2. Open the service account key you downloaded from BigQuery in a text editor, and **copy** the contents.
3. In the **Key** field, paste the contents of the service account key into the text box.
4. Click **Test and Save** to complete the connection.

Once an integration is established, open a workflow and select **Import from BigQuery** to pull data from your database into Cascade.
