# BigQuery

In order to write Data into your BigQuery warehouse, Whaly needs additional configuration on Google Cloud side. This guide will details the necessary steps:

1. Creation of a Google Cloud Storage Bucket
2. Giving permissions to your service account to the Storage Bucket

{% hint style="info" %}
Steps where you need to paste info from the google cloud console to Whaly are identified with a :scissors:
{% endhint %}

### Prerequisites <a href="#prerequisites" id="prerequisites"></a>

To connect BigQuery to Whaly, you need the following:

* A Google Cloud Project
* Billing enabled on your Google Cloud Project
* Admin rights on the Google Cloud Console
* A Service Account already configured in Whaly

## 1. Create a Google Cloud Storage bucket

In Google Cloud, Cloud Storage buckets are data repositories that are used to load or save data within Google Cloud. Whaly is using a Google Cloud Storage bucket to load data from its connector into your BigQuery tables.

* Go to the **Cloud Storage** tab, and go to the [browser page](https://console.cloud.google.com/storage/browser).
* Click on "Create Bucket"

![](https://34758050-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MC1g4I2_CgXd0qAq1P7%2Fuploads%2FeiKhMV9q2S38TYdDd3MV%2Fimage.png?alt=media\&token=8795d8a9-124d-4730-8c60-ae2edfa2cb44)

* Create the bucket:
  * **Name**: The name that you want to keep, ex. "`whaly-connectors-loading-deck`"
  * **Location** type: We advise "Multi-region" for maximum reliability
  * **Location**: The region in which your BigQuery data is (EU / US) --> :scissors:Set the same value in the Whaly form.
  * **Storage class**: Standard
  * **Access control**: Fine grained
  * **Protection tool**: None
* :scissors:Open the details for the bucket you've just created, open the configuration tab, and paste the gsutil URI into Whaly:

![](https://34758050-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MC1g4I2_CgXd0qAq1P7%2Fuploads%2F0gzijghvPVj570DMfyJb%2Fimage.png?alt=media\&token=e6d62ab0-2aeb-4985-8506-257033672b5f)

## 2. Give permissions to the Whaly Service Account on the Cloud Storage Bucket

You must give the service account (in the setup form) **Storage Admin** permission for the bucket, so that it can read and write the data from the bucket.

* In your Google Cloud Console, go [**Storage > Browser**](https://console.cloud.google.com/storage/browser?_ga=2.91914202.-115928388.1548358412) to see the list of buckets in your current project.
* Select the bucket you want to use.

![](https://34758050-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MC1g4I2_CgXd0qAq1P7%2Fuploads%2Fl25TzjEKoRrw0eHOWQPX%2Fimage.png?alt=media\&token=083f5b2b-9026-4580-a5f5-9149521ab2ac)

* Go to **Permissions** and then click **Add Members**.

![](https://34758050-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MC1g4I2_CgXd0qAq1P7%2Fuploads%2FFvAIT2JvEuJS9eY1abcG%2Fimage.png?alt=media\&token=8fd8052d-cbe5-447b-9af7-568ed830d142)

* In the **Add members** window, enter the **Whaly service account email**.
* From the **Select a role** dropdown, select **Storage Admin**

![](https://34758050-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MC1g4I2_CgXd0qAq1P7%2Fuploads%2Fs07mZwwU9tYyN2pKT6dq%2FScreenshot%202021-12-21%20at%2013.55.06.png?alt=media\&token=2bd7c654-15dc-448c-9559-4dad269a20bd)

3. In Whaly, go in your "Warehouse" page in the Settings and paste the `gsutil URI` value in the "GCS Bucket Name" field.

<figure><img src="https://34758050-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MC1g4I2_CgXd0qAq1P7%2Fuploads%2Frk8vyTl3sUKTLffnwmeI%2Fimage.png?alt=media&#x26;token=48895adf-0c77-481c-9f99-9ee98feb0ee9" alt=""><figcaption></figcaption></figure>

That's it, your BigQuery setup is all set for being used with Whaly connectors :tada:
