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.ymlconfiguration file: Define one or more named environments, each with plain-text values, SQL-computed values, and Snowflake-managed secrets. Snowflake resolvesenv.ymlbefore dbt starts and injects the resulting environment variables into the run. -
SQL in YAML: Because
env.ymlresolves in your session’s execution context before dbt starts, values can come from live SQL. Use context functions likeCURRENT_USER(),CURRENT_ROLE(), orCURRENT_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_ENVIRONMENTon the dbt project object (set with CREATE DBT PROJECT or ALTER DBT PROJECT) orENVIRONMENTon EXECUTE DBT PROJECT. Override individual variables per run withENV_VARS.SHOW DBT PROJECTSreports the object’sdefault_environment, and theSNOWFLAKE.ACCOUNT_USAGE.DBT_PROJECT_EXECUTION_HISTORYview records theENVIRONMENTused for each run. -
Private Git packages: Authenticate
dbt depsagainst private Git repositories by referencing a Snowflake secret fromenv.ymlas aDBT_ENV_SECRET_variable, with a network rule and external access integration. -
Works across all surfaces: Use
env.ymlin 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-varsrequire Snowflake CLI 3.21 or later.
For more information, see Using SQL environment variables and private Git packages for dbt Projects on Snowflake.