This guide packages the repo's dlt -> dbt flow as a Databricks Job using
databricks.yml. Use it after local setup and make doctor are clean.
For local development, use OAuth:
databricks auth login --host https://YOUR_HOST.cloud.databricks.com
databricks auth profilesThe active/default profile should show Valid = YES. The bundle can use either a valid default
profile or DATABRICKS_HOST in the shell.
The bundle needs:
| Variable | Source | Purpose |
|---|---|---|
warehouse_id |
DATABRICKS_WAREHOUSE_ID or the id in DATABRICKS_HTTP_PATH |
SQL warehouse for the dbt task |
catalog |
DATABRICKS_CATALOG, default workspace |
Unity Catalog catalog |
schema |
DATABRICKS_SCHEMA, default analytics |
dbt output schema |
orchestration/doctor.py derives warehouse_id from an HTTP path like
/sql/1.0/warehouses/abcd1234efgh5678, so you usually do not need to duplicate it.
Run the offline doctor first:
make doctorThen run the authenticated validation:
make doctor-onlineEquivalent explicit command:
databricks bundle validate `
--var warehouse_id=YOUR_WAREHOUSE_ID `
--var catalog=workspace `
--var schema=analyticsDeploy the development target:
databricks bundle deploy -t dev `
--var warehouse_id=YOUR_WAREHOUSE_ID `
--var catalog=workspace `
--var schema=analyticsRun the job:
databricks bundle run dlt_dbt_pipeline -t devThe job has two tasks:
dlt_ingestrunsingestion/pipelines/rest_api_to_databricks.py.dbt_buildrunsdbt depsanddbt buildafter ingestion succeeds.
Inspect runs in Databricks Jobs / Lakeflow Jobs. The job name is
dlt-dbt-databricks [dev] for the dev target.
For production, prefer a service principal instead of user OAuth:
- Configure Databricks CLI auth for the service principal in CI/CD or your deployment host.
- Give the principal access to the target catalog, raw schema, analytics schema, and SQL warehouse.
- Use the
prodbundle target:
databricks bundle deploy -t prod `
--var warehouse_id=YOUR_WAREHOUSE_ID `
--var catalog=workspace `
--var schema=analyticsKeep secret values out of databricks.yml. Use Databricks secrets, CI/CD secrets, or environment
variables for credentials. The bundle should only contain deployable infrastructure and non-secret
configuration.
workspace.hostinterpolation error: do not setworkspace.host: ${var...}. Use CLI auth,DATABRICKS_HOST, or a Databricks CLI profile.warehouse_iderrors: confirm the warehouse id matches the id in the SQL warehouse HTTP path.- Permission errors: the deploying principal needs workspace job permissions and catalog/schema/table privileges.
- dbt task failures: run
make dbt-parselocally, then inspect the Databricks task logs for SQL warehouse connectivity or permission issues.