Skip to main content
(Applies to dbt v2.0 and later)

Connect BigQuery to Fusion Preview

You can configure the BigQuery adapter by running dbt init in your CLI or manually providing the profiles.yml file with the fields configured for your authentication type.

The BigQuery adapter for Fusion supports the following authentication methods:

  • Service account (JSON file)
  • gcloud OAuth
  • Workload Identity Federation (Microsoft Entra)

Warehouse permissions

The Google Cloud identity (service account or user) that dbt Fusion engine uses must have IAM permissions to run jobs, read and write table data, and read metadata Fusion uses for introspection and source freshness.

Required Google Cloud objects

Before connecting, these objects must exist or be accessible:

ObjectBigQuery termPurpose
ProjectGCP projectYour Google Cloud project ID
DatasetDatasetTarget dataset (equivalent to a schema)
Service account or userIAM identityIdentity for authentication
Location or regionLocationData location (for example, US, EU, us-east1)

IAM permissions

The following permissions are required for fundamental dbt features::

PermissionPurpose
bigquery.datasets.getAccess dataset metadata
bigquery.tables.createCreate tables
bigquery.tables.deleteDrop or replace tables
bigquery.tables.getRead table metadata
bigquery.tables.getDataRead table data
bigquery.tables.listList tables in dataset
bigquery.tables.updateUpdate table schema
bigquery.tables.updateDataInsert, update, or delete rows
bigquery.jobs.createRun queries

The following are optional permissions for additional dbt features:

PermissionWhen required
bigquery.datasets.createAuto-create datasets
bigquery.routines.createCreate UDFs or stored procedures
bigquery.jobs.getMonitor job status
storage.objects.createPython models (GCS staging)
dataproc.*Python models on Dataproc

Predefined IAM roles

The following roles represent the typical starting point for dbt access:

RoleDescriptionUse case
roles/bigquery.dataEditorRead and write tables in datasetsStandard dbt operations
roles/bigquery.userRun jobs, create datasetsJob execution
roles/bigquery.jobUserRun jobs onlyMinimal query execution

For Storage Read API access with Fusion, also grant BigQuery Read Session User (roles/bigquery.readSessionUser) on the project, as noted in Connect BigQuery.

Metadata operations

The following are required for fundamental dbt features:

Query typeSQL or API usedRequired permission
Get table schemaget_table_schema APIbigquery.tables.get
List relationsQuery against datasetbigquery.tables.list
Source freshnessQuery __TABLES__ metadatabigquery.tables.get
Get table statsQuery INFORMATION_SCHEMAbigquery.tables.get
Create datasetCREATE SCHEMAbigquery.datasets.create

INFORMATION_SCHEMA and metadata views

Fusion queries these BigQuery system views:

ViewPurposeScope
INFORMATION_SCHEMA.TABLESList tablesDataset or region
INFORMATION_SCHEMA.COLUMNSColumn metadataDataset or region
INFORMATION_SCHEMA.VIEWSView definitionsDataset or region
INFORMATION_SCHEMA.PARTITIONSPartition informationDataset only
__TABLES__ (deprecated)Table modification timesDataset

BigQuery DataFrames (optional)

For BigQuery DataFrames workflows, users typically need additional roles such as BigQuery Job User, BigQuery Read Session User, Notebook Runtime User, Code Creator, and colabEnterpriseUser. See your Google Cloud admin for exact role names in your organization.

Configure Fusion

Executing dbt init in your CLI will prompt for the following fields:

  • Project ID: The GCP BigQuery project ID
  • Dataset: The schema name
  • Location: The location for your GCP environment (for example, us-east1)

Alternatively, you can manually create the profiles.yml file and configure the fields. See examples in authentication section for formatting. If there is an existing profiles.yml file, you have the option to retain the existing fields or overwrite them.

Next, select your authentication method. Follow the on-screen prompts to provide the required information.

Supported authentication types

Selecting the Service account (JSON file) authentication type will prompt you for the path to your JSON file. You can also manually define the path in your profiles.yml file.

Example service account JSON file configuration

profiles.yml
default:
target: dev
outputs:
dev:
type: bigquery
threads: 16
database: ABC123
schema: JAFFLE_SHOP
method: service-account
keyfile: /Users/youruser/Downloads/CustomRoleDefinition.json
location: us-east1
dataproc_batch: null

More information

Find BigQuery-specific configuration information in the BigQuery adapter reference guide.

Was this page helpful?

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

0
Loading