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