July 20, 2026: SQL environment variable and private Git package support for dbt Projects on Snowflake

Environment variable support for dbt Projects on Snowflake is now generally available. Manage per-developer schemas, dynamic runtime values, secrets, and multiple environments in a single, Git-versioned env.yml file that Snowflake resolves before each run.

  • env.yml configuration file: Define one or more named environments, each with plain-text values, SQL-computed values, and Snowflake-managed secrets. Snowflake resolves env.yml before dbt starts and injects the resulting environment variables into the run.

  • SQL in YAML: Because env.yml resolves in your session’s execution context before dbt starts, values can come from live SQL. Use context functions like CURRENT_USER(), CURRENT_ROLE(), or CURRENT_WAREHOUSE() to give each developer an isolated configuration, or query control tables, task history, and stored procedures to build robust orchestration that pulls run-time metadata, such as incremental data windows, into the run before your models execute.

  • Environment selection and overrides: Select the active environment with DEFAULT_ENVIRONMENT on the dbt project object (set with CREATE DBT PROJECT or ALTER DBT PROJECT) or ENVIRONMENT on EXECUTE DBT PROJECT. Override individual variables per run with ENV_VARS. SHOW DBT PROJECTS reports the object’s default_environment, and the SNOWFLAKE.ACCOUNT_USAGE.DBT_PROJECT_EXECUTION_HISTORY view records the ENVIRONMENT used for each run.

  • Private Git packages: Authenticate dbt deps against private Git repositories by referencing a Snowflake secret from env.yml as a DBT_ENV_SECRET_ variable, with a network rule and external access integration.

  • Works across all surfaces: Use env.yml in Workspaces, in deployed dbt project objects (through SQL and the Snowflake CLI), and in CoCo Desktop in Snowflake-managed mode. The Snowflake CLI flags --env-file-dir, --default-env, --env, --env-vars, and --use-shell-env-vars require Snowflake CLI 3.21 or later.

For more information, see Using SQL environment variables and private Git packages for dbt Projects on Snowflake.