Skip to main content
BigQuery hero Openlayer integrates with Google BigQuery so you can run data quality tests directly on your BigQuery tables.

Authentication methods

Openlayer supports two ways to authenticate with BigQuery:
If you are unsure which method to choose, Service Account Impersonation is Google’s recommended approach because it avoids long-lived credentials.

Prerequisites

Both methods require:

Setup Guide

Step 1: Create a service account and grant roles

Create a dedicated service account in your GCP project for Openlayer to use:
Grant the following roles to the new service account:
  • roles/bigquery.jobUser: run queries
  • roles/bigquery.dataViewer: read table data
  • roles/bigquery.metadataViewer: read metadata

Step 2: Configure authentication and connect

In your Openlayer project, open Monitoring → Data sources and click Create a data source. Under Manual setup, select BigQuery. Choose your authentication method and follow the corresponding tab:

Allow Openlayer to impersonate your service account

Grant Openlayer’s service account permission to impersonate yours:
This ensures Openlayer can act as your service account without exchanging keys.

Fill in the connection fields

  • BigQuery target principal: your service account email (e.g. openlayer-bigquery@your-project-id.iam.gserviceaccount.com)
  • BigQuery billing project: your GCP project ID (where query costs are billed)
  • Name: a descriptive label for this connection
The BigQuery connection form with Service account impersonation selected, and the BigQuery target principal, BigQuery billing project, and Name fields

Step 3: Configure your table

After the connection is created, fill in the table you want to monitor:
  • BigQuery project: GCP project containing the table
  • BigQuery dataset: dataset name
  • BigQuery tables: one or more tables
  • Timestamp column name (optional): column used to order or filter rows for monitoring windows. This field is not required for BigQuery.
  • Unique ID column name (optional): column used to identify unique rows. This field is not required for BigQuery; if you omit it, Openlayer auto-detects it.
  • Data source name: a descriptive name for each table in Openlayer (defaults to dataset.table)
The BigQuery Fill in fields step, with the project, dataset, and table selected and the data source name for the table

Optional: ML-specific settings

If the table contains ML outputs, you can provide additional context:
  • Class names
  • Feature names
  • Categorical feature names
These let Openlayer run model-aware tests, such as drift or performance monitoring.

Multiple connections

You can create multiple BigQuery connections in the same Openlayer workspace — each with its own authentication method, billing project, and service account. This is useful when:
  • Different teams own different GCP projects
  • You want to isolate billing across data sources
  • Different tables require different access permissions
Each connection is independent, so you can mix Service Account Impersonation and Service Account Key connections as needed.

Security considerations

No keys exchanged — Openlayer never holds long-lived credentials for your project.Auditable — every impersonated action is logged in Cloud Audit Logs under both the impersonator and target accounts.Revocable — remove the serviceAccountTokenCreator role to revoke access instantly.
Encrypted at rest — uploaded keys are encrypted and stored securely in Openlayer’s infrastructure.Rotate regularly — set a reminder to rotate keys at least every 90 days.Least privilege — only grant the three BigQuery roles listed above. Avoid roles/owner or roles/editor.Revoke if compromised — delete the key in the GCP console and generate a new one.

Troubleshooting

  • Permission errors → confirm the roles above are granted to your service account.
  • Impersonation errors → ensure roles/iam.serviceAccountTokenCreator is granted to Openlayer’s service account (impersonator@unbox-ai.iam.gserviceaccount.com).
  • Invalid key errors → verify the uploaded JSON file is the correct service account key and has not been revoked.
  • Billing errors → check that the billing project ID is correct and that the service account has bigquery.jobUser on that project.