BigQuery
Create a service account to connect BigQuery to Credible, and set a billing project and cost limits
To connect BigQuery to Credible, create a Google Cloud service account and download its JSON key.
Create a Service Account
- Go to the Google Cloud Console (opens in a new tab)
- Select your project
- Navigate to IAM & Admin > Service Accounts
- Click Create Service Account
- Enter a name (e.g.,
credible-bigquery) - Click Create and Continue
Assign Permissions
Add these roles to the service account:
- BigQuery Data Viewer, to read tables
- BigQuery Job User, to run queries
If you need write access, use BigQuery Data Editor instead of Data Viewer.
To use BigQuery through a DuckDB connection, also add BigQuery Read Session User.
Click Continue, then Done.
Download the JSON Key
- Find your service account in the list and click on it
- Go to the Keys tab
- Click Add Key > Create new key
- Select JSON and click Create
The JSON key file downloads automatically. Keep it secure: it gives access to your BigQuery data.
Never commit JSON key files to version control.
Connect in Credible
- In the connection form, choose BigQuery
- Upload the JSON key file under Service Account
- Optionally, fill in the settings below
- Click Test Connection, then Connect
Optional Settings
| Setting | Example | What it does |
|---|---|---|
| Default Project ID | my-project | The project for table names that don't name one. Defaults to the key's project |
| Billing Project ID | my-billing-project | The project that runs and pays for queries, when it differs from the data's project. The service account needs BigQuery Job User there |
| Location | US, EU, asia-northeast1 | Where queries run. Set it to your datasets' location |
| Maximum Bytes Billed | 1000000000 | BigQuery refuses any query that would bill more bytes than this. A guard against expensive queries |
| Query Timeout (ms) | 60000 | How long Credible waits for a query to finish |
From the CLI
To add the connection with cred add connection, put an entry like this in the JSON file:
[
{
"name": "warehouse",
"type": "bigquery",
"bigqueryConnection": {
"serviceAccountKeyJson": "{\"type\": \"service_account\", \"project_id\": \"my-project\", ...}",
"defaultProjectId": "my-project",
"location": "US"
}
}
]serviceAccountKeyJson holds the whole key file as one string, with its quotes escaped. The optional settings are billingProjectId, maximumBytesBilled and queryTimeoutMilliseconds, all strings.
Troubleshooting
| Problem | Cause | Fix |
|---|---|---|
Access Denied: ... User does not have bigquery.jobs.create permission | The service account lacks BigQuery Job User in the billing project | Add the role, or set Billing Project ID to a project where it has it |
Query exceeded limit for bytes billed | The query would scan more than Maximum Bytes Billed | Raise the limit, or filter on a partition column so the query scans less |
Not found: Dataset ... was not found in location | Location does not match the dataset's location | Set Location to the dataset's location |