Deploy dbt projects to Snowflake
Main skill routes here for: "deploy", "create project", "upload dbt"
Target schema must exist:
CREATE SCHEMA IF NOT EXISTS my_db.my_schema;
profiles.yml requirements - Load references/profiles-yml.md for details:
env_var() - dbt runs inside Snowflakepassword or authenticator fieldsMinimum project structure:
my_dbt_project/
├── dbt_project.yml
├── profiles.yml ← MUST be here, inside the project directory
└── models/
└── my_model.sql
IMPORTANT: profiles.yml MUST be placed inside the dbt project directory (alongside dbt_project.yml), NOT in ~/.dbt/. The snow dbt deploy command bundles profiles.yml from the project directory into the deployed project.
Goal: Ensure project is ready for deployment
Actions:
dbt_project.yml existsprofiles.yml exists and has no env_var() or password fieldsmodels/ directory has at least one .sql fileIf validation fails due to env_var() or password in profiles.yml / project files:
This is a migration case. Load migrate/SKILL.md and run the migration workflow first, then return here to deploy the migrated project.
Goal: Ensure target schema exists
CREATE SCHEMA IF NOT EXISTS <database>.<schema>;
Goal: Determine if the project needs external network access
When is external access needed? If the project needs to reach external hosts at runtime (e.g., to resolve packages, call APIs, etc.), it needs an External Access Integration (EAI) attached at deploy time.
Actions:
SHOW EXTERNAL ACCESS INTEGRATIONS;
Goal: Upload project to Snowflake
Command (works for new projects AND updates):
snow dbt deploy <project_name> \
--source <path_to_project> \
--database <database> \
--schema <schema> \
--external-access-integration <integration_name> # if project needs external network access
Parameters:
| Parameter | Description |
|---|---|
<project_name> | Identifier for the project (required) |
--source | Path to dbt project directory |
--database | Target database |
--schema | Target schema |
--external-access-integration | Name of an External Access Integration (required if project needs external network access) |
Example - Deploy without external packages:
snow dbt deploy MY_PROJECT --source /path/to/project --database DB --schema SCHEMA
Example - Deploy with external access:
snow dbt deploy MY_PROJECT --source /path/to/project --database DB --schema SCHEMA \
--external-access-integration MY_EAI
Example - Update (creates VERSION$2, VERSION$3, etc.):
# Same command! Just point to updated source
snow dbt deploy MY_PROJECT --source /path/to/updated_project --database DB --schema SCHEMA \
--external-access-integration MY_EAI
Goal: Confirm project was deployed with correct version
snow dbt list --in schema <schema> --database <database>
--databasedefaults to the connection's database if omitted.--in schemadefaults to all schemas if omitted.
Check versions:
SHOW VERSIONS IN DBT PROJECT <database>.<schema>.<project_name>;
Deployed dbt project in Snowflake, ready for execution.
After deployment, load execute/SKILL.md to run models.
Important: If you fixed an incremental model (changed is_incremental() logic, unique key, or strategy), you MUST execute with --full-refresh to rebuild the table from scratch. A normal run only processes new rows and won't fix data built by the old broken logic.