// Step-by-step setup guide for dbt Projects on Snowflake including prerequisites, external access integration, Git API integration, event table configuration, and automated scheduling. Use this skill when setting up dbt Projects on Snowflake for the first time or troubleshooting setup issues.
| name | dbt-projects-snowflake-setup |
| description | Step-by-step setup guide for dbt Projects on Snowflake including prerequisites, external access integration, Git API integration, event table configuration, and automated scheduling. Use this skill when setting up dbt Projects on Snowflake for the first time or troubleshooting setup issues. |
Complete step-by-step guide for setting up dbt Projects on Snowflake from beginning to end.
Activate this skill when users ask about:
1. Snowflake Account
2. Git Repository
ALTER ACCOUNT SET ENABLE_PERSONAL_DATABASE = TRUE;
For dbt deps to work, allow external access to dbt packages:
-- Create NETWORK RULE
CREATE OR REPLACE NETWORK RULE dbt_network_rule
MODE = EGRESS
TYPE = HOST_PORT
VALUE_LIST = (
'hub.getdbt.com',
'codeload.github.com'
);
-- Create EXTERNAL ACCESS INTEGRATION
CREATE OR REPLACE EXTERNAL ACCESS INTEGRATION dbt_ext_access
ALLOWED_NETWORK_RULES = (dbt_network_rule)
ENABLED = TRUE;
Purpose: Allows dbt to download packages from hub.getdbt.com and GitHub during dbt deps execution.
Choose the appropriate integration for your Git provider:
CREATE OR REPLACE API INTEGRATION git_api_integration
API_PROVIDER = git_https_api
API_ALLOWED_PREFIXES = (
'https://github.com/',
'https://github.com/organization/'
);
CREATE OR REPLACE API INTEGRATION git_api_integration
API_PROVIDER = git_https_api
API_ALLOWED_PREFIXES = (
'https://gitlab.com/'
);
CREATE OR REPLACE API INTEGRATION git_api_integration
API_PROVIDER = git_https_api
API_ALLOWED_PREFIXES = (
'https://dev.azure.com/'
);
Purpose: Allows Snowflake to connect to your Git repository for workspace creation and project deployment.
git_api_integration)Note: Workspace creation is only available through the Snowsight UI. The Snowflake CLI does not have commands for creating workspaces.
In your workspace, configure profiles.yml:
my_dbt_project:
target: dev
outputs:
dev:
type: snowflake
account: "" # Uses current account context
user: "" # Uses current user context
warehouse: MY_WAREHOUSE
database: MY_DATABASE
schema: MY_SCHEMA
role: MY_ROLE
Important Notes:
account and user empty - Snowflake provides these automaticallyUI Method:
CLI Method:
snow dbt deploy my_project --source .
Verify Deployment:
SHOW DBT PROJECTS IN DATABASE MY_DATABASE;
Monitor dbt Projects execution using event tables that capture telemetry data (logs, traces, metrics) via the OpenTelemetry data model.
Always set event tables at the DATABASE level (not schema, not account-wide):
-- Step 1: Create event table (can be in different database)
CREATE EVENT TABLE IF NOT EXISTS MY_LOGGING_DATABASE.MY_LOGGING_SCHEMA.EVENT_LOG;
-- Step 2: Set event table where dbt Projects are deployed at DATABASE level
ALTER DATABASE MY_DBT_PROJECT_DATABASE
SET EVENT_TABLE = MY_LOGGING_DATABASE.MY_LOGGING_SCHEMA.EVENT_LOG;
-- Step 3: Configure logging levels for the schema where dbt Project is deployed
ALTER SCHEMA MY_DBT_PROJECT_DATABASE.MY_DBT_PROJECT_SCHEMA SET LOG_LEVEL = 'INFO';
ALTER SCHEMA MY_DBT_PROJECT_DATABASE.MY_DBT_PROJECT_SCHEMA SET TRACE_LEVEL = 'ALWAYS';
ALTER SCHEMA MY_DBT_PROJECT_DATABASE.MY_DBT_PROJECT_SCHEMA SET METRIC_LEVEL = 'ALL';
✅ DO:
❌ DON'T:
After configuration, verify events are being captured:
-- Check recent events
SELECT
TIMESTAMP,
RESOURCE_ATTRIBUTES['snow.executable.name']::VARCHAR AS project_name,
RECORD_TYPE,
RECORD['severity_text']::VARCHAR AS severity,
VALUE::VARCHAR AS message
FROM MY_LOGGING_DATABASE.MY_LOGGING_SCHEMA.EVENT_LOG
WHERE RESOURCE_ATTRIBUTES['snow.executable.type']::VARCHAR = 'DBT_PROJECT'
AND TIMESTAMP >= DATEADD(hour, -1, CURRENT_TIMESTAMP())
ORDER BY TIMESTAMP DESC
LIMIT 10;
For complete monitoring guide, see the dbt-projects-on-snowflake skill for:
Create a Snowflake task to run dbt on a schedule:
CREATE OR REPLACE TASK my_dbt_daily_task
WAREHOUSE = 'MY_WAREHOUSE'
SCHEDULE = 'USING CRON 0 6 * * * UTC' -- Daily at 6 AM UTC
AS
EXECUTE DBT PROJECT MY_DATABASE.MY_SCHEMA.MY_DBT_PROJECT
args='build';
-- Enable the task
ALTER TASK my_dbt_daily_task RESUME;
| Parameter | Purpose | Example |
|---|---|---|
| Task name | Identifies the scheduled job | my_dbt_daily_task |
| Warehouse | Compute resources | MY_WAREHOUSE |
| Schedule | CRON expression | 0 6 * * * UTC (daily 6 AM) |
| Database/Schema/Project | Target dbt project | MY_DB.MY_SCHEMA.MY_PROJECT |
| Args | dbt command arguments | 'build', 'run --select tag:daily' |
-- Hourly
SCHEDULE = 'USING CRON 0 * * * * UTC'
-- Daily at 2 AM
SCHEDULE = 'USING CRON 0 2 * * * UTC'
-- Every 15 minutes
SCHEDULE = '15 MINUTE'
-- Weekly on Monday at 8 AM
SCHEDULE = 'USING CRON 0 8 * * 1 UTC'
-- View task history
SELECT *
FROM TABLE(INFORMATION_SCHEMA.TASK_HISTORY(
SCHEDULED_TIME_RANGE_START => DATEADD('day', -7, CURRENT_TIMESTAMP()),
TASK_NAME => 'MY_DBT_DAILY_TASK'
))
ORDER BY SCHEDULED_TIME DESC;
Problem: Can't download dbt packages or connect to Git
Solutions:
Verify external access integration exists:
SHOW EXTERNAL ACCESS INTEGRATIONS;
Check network rules include required hosts:
DESCRIBE EXTERNAL ACCESS INTEGRATION dbt_ext_access;
Ensure required hosts are in VALUE_LIST:
hub.getdbt.com (for dbt packages)codeload.github.com (for GitHub packages)Problem: Git authentication fails in workspace creation
Solutions:
Verify PAT has correct scopes:
repo scoperead_repository scopeCode (Read) permissionCheck API integration is created:
SHOW API INTEGRATIONS;
Verify API allowed prefixes match your repository URL
Problem: dbt deps fails in workspace
Solutions:
dbt deps manually in workspace before deploymentALTER EXTERNAL ACCESS INTEGRATION dbt_ext_access SET ENABLED = TRUE;
Problem: No events appearing in event table
Solutions:
Verify event table is set at DATABASE level:
SHOW PARAMETERS LIKE 'EVENT_TABLE' IN DATABASE MY_DATABASE;
Check logging levels are set for schema:
SHOW PARAMETERS LIKE '%_LEVEL' IN SCHEMA MY_DATABASE.MY_SCHEMA;
Ensure dbt Project has executed at least once after configuration
Query with correct filter:
WHERE RESOURCE_ATTRIBUTES['snow.executable.type']::VARCHAR = 'DBT_PROJECT'
Problem: Can't create workspace from Git repository
Solutions:
Verify personal database is enabled:
SHOW PARAMETERS LIKE 'ENABLE_PERSONAL_DATABASE' IN ACCOUNT;
Check you have required role (ACCOUNTADMIN or sufficient grants)
Ensure Git repository URL is correct and accessible
Verify Git API integration exists and has correct allowed prefixes:
SHOW API INTEGRATIONS;
DESCRIBE API INTEGRATION git_api_integration;
Check PAT/OAuth token has correct permissions for the repository
✅ DO:
❌ DON'T:
✅ DO:
{env}_dbt_project)❌ DON'T:
✅ DO:
❌ DON'T:
SHOW DBT PROJECTSEXECUTE DBT PROJECTdbt-projects-on-snowflake skill - Complete monitoring, execution, and management guidedbt-core skill - dbt-core setup and profiles.yml configurationsnowflake-connections skill - Snowflake authentication and connection configurationsnowflake-cli skill - Snowflake CLI commands and operationsGoal: Transform AI agents into experts at setting up dbt Projects on Snowflake from scratch with proper integrations, monitoring, and automation configured from day one.