Configuring dbt Cloud to Differentiate Between Development and Production Environments in BigQuery

The Problem

I’m unable to configure dbt Cloud to send production runs to a separate Google Cloud Project from the development one. This is crucial for a proper dev/prod separation in BigQuery.


I’m building a data infrastructure from the ground up for a company without any existing setup. We plan to have individual datasets for each developer within a single development project in BigQuery, while the production project will have distinct datasets for each data layer (marts, intermediate, staging). My experience with Snowflake hasn’t fully translated to understanding BigQuery’s interaction with dbt Cloud, and I want to ensure we set a strong foundation from the beginning.

What I’ve Tried

I attempted to dynamically set the project name in dbt_project.yml. However, production jobs continue to route data to the development project. Directly setting the target to the project production results in job failure.

Example Code

  +materialized: table
  +project: |
    {%- if == "development" -%}
    {%- endif -%}
  {%- if != "development" -%}
  +dataset: marts
  {%- endif -%}

Any suggestions or guidance on how to approach this configuration would be greatly appreciated.