> For the complete documentation index, see [llms.txt](https://docs.tonic.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tonic.ai/app/setting-up-your-database/google-bigquery/bigquery-before-create-workspace.md).

# Before you create a Google BigQuery workspace

## Creating the service accounts for the source and destination databases <a href="#bigquery-source-destination-service-accounts" id="bigquery-source-destination-service-accounts"></a>

Tonic Structural uses service accounts to access both the source and destination datasets.

Even if the source and destination are in the same BigQuery project, Structural recommends that you create separate service accounts for the source and destination.

When you create the service account for the source dataset, you should use the "Viewer" role to grant the service account access to the project. Structural does not require write permissions to the source dataset.

When you create the service account for the destination dataset, you should use the "Editor" role to grant the service account access to the project.

## Setting up Application Default Credentials (self-hosted only)

Structural Cloud users must use service accounts for database connections.

Self-hosted instances can also use [Application Default Credentials (ADC)](https://docs.cloud.google.com/docs/authentication/application-default-credentials).

The credentials are loaded using ADC chain. For example, the credentials might be loaded from the `GOOGLE_APPLICATION_CREDENTIALS` environment variable, or from attached service accounts on the Tonic Structural containers.


---

# 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.tonic.ai/app/setting-up-your-database/google-bigquery/bigquery-before-create-workspace.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.
