Connecting BigQuery
Step 1: Create a service account
- In the Google Cloud console, open IAM & Admin > Service Accounts for the project that owns your BigQuery data.
- Click Create Service Account and give it a descriptive name (e.g.,
delphina-warehouse). - Skip the optional “Grant access to project” step — you’ll grant roles in Step 2.
- After creating the account, open it, go to Keys, and click Add Key > Create new key > JSON. Save the JSON file; you’ll upload it to Delphina in Step 3.
Step 2: Grant the service account IAM roles
The required roles depend on which features you want Delphina to use. The standard set below covers all of them and is the recommended starting point.- Standard set (recommended)
- Minimal set (data access only)
Grant the service account this combined set of roles. It covers data access, query history, and masked columns.
Grant
| Role | Purpose |
|---|---|
roles/bigquery.jobUser | Create query jobs |
roles/bigquery.dataViewer | Read table data |
roles/bigquery.metadataViewer | Read dataset/table metadata |
roles/bigquery.readSessionUser | Read large result sets via the Storage Read API |
roles/bigquery.resourceViewer | View reservations and slot assignments |
roles/batch.jobsViewer | Read job execution metadata |
bigquerydatapolicy.maskedReader | Read masked PII columns |
dataViewer and metadataViewer at the dataset level (or project level if you want Delphina to see everything). The remaining roles can be granted at the project level.Step 3: Create the connection in Delphina
- Navigate to analytics.delphina.ai.
- Click your name in the bottom-left, then Org Admin > Warehouse Connections.
- Click Add Connection on the target workspace.
- Set the Warehouse Type to BigQuery.
-
Paste the service account JSON. It should include the following fields:
typeproject_idprivate_key_idprivate_keyclient_emailclient_idauth_uritoken_uriauth_provider_x509_cert_urlclient_x509_cert_urluniverse_domain
- Click Create Connection, then Test Connection to verify Delphina can authenticate, list datasets, and read query history.
Troubleshooting
| Problem | Fix |
|---|---|
| Test Connection fails | Verify the JSON key is valid and the service account exists. Re-download the key from Google Cloud if in doubt. |
| ”Browse Tables” empty | Grant bigquery.metadataViewer on the datasets you want to expose to Delphina. |
| Queries fail with permission denied | Add bigquery.dataViewer on the specific tables — metadataViewer lists tables but does not read them. |
| ”Show Top Users” empty | Confirm bigquery.readSessionUser, bigquery.resourceViewer, and batch.jobsViewer are granted at the project level. |
Masked columns return NULL | Grant bigquerydatapolicy.maskedReader to the service account so it can read masked values. |