> For the complete documentation index, see [llms.txt](https://docs.hockeystack.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hockeystack.com/integrations/datasyncs/connecting-your-warehouse/authenticate-bigquery.md).

# 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
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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.hockeystack.com/integrations/datasyncs/connecting-your-warehouse/authenticate-bigquery.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
