# Authenticate BigQuery

### Ensure that DataSyncs has correct permissions to access your BigQuery instance

1. Go to **Google Cloud Console → IAM & Admin → Service Accounts**.
2. Click **Create Service Account**, name it, and click **Create**.
3. **Assign Permissions**
   * Grant **BigQuery Data Viewer** (`roles/bigquery.dataViewer`) for ***read*** access or **Big Query Data Editor** (`roles/bigquery.dataEditor`) for ***write*** access.
   * Grant **BigQuery Job User** (`roles/bigquery.jobUser`) to allow query execution.
     * This permission is necessary to ensure that we can actually pull information
4. After service account user creation, create a new JSON key and download it securely. This key will be used as part of the authentication for BigQuery

### **Gather Connection Information for DataSyncs**

* The JSON key you downloaded will have connection information that you can directly upload when configuring a sync
* **Dataset ID:** the specific dataset that contains the table you are importing&#x20;
* **Table Name:** the specific table that you are importing

### Setting a limit on service account user (optional)

Larger imports (>100k rows) can increase compute costs. Setting a quota ensure no unexpected compute costs:&#x20;

* Refer to BigQuery's[ Quota and Limits documentation](https://cloud.google.com/bigquery/quotas) to see which options are available to as limits you can set on the service account you are providing to DataSyncs


---

# Agent Instructions: 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.hockeystack.com/integrations/datasyncs/connecting-your-warehouse/authenticate-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.
