Promoting data workflows across environments is a critical step, and setting it up correctly from the start will save you a lot of operational headaches.
The recommended and most robust methodology for managing the lifecycle of both Lakeflow Connect jobs and Spark Declarative Pipelines (SDP) is using Databricks Asset Bundles (DABs). DABs allow you to express your entire data project pipelines, jobs, and environment configurations as code, making them perfect for CI/CD integration.
Here is a practical, step-by-step blueprint to setting this up:
1. Structure Your Project with a Bundle
Instead of creating jobs manually in the Databricks UI, you will define your Lakeflow Connect ingestion tasks and your SDP (Bronze to Silver) inside a databricks.yml configuration file.
Here is a practical example of what that file might look like:
bundle:
name: sql_ingestion_project
# Define your pipelines and jobs here
resources:
pipelines:
bronze_to_silver_sdp:
name: "SDP_Bronze_Silver_[${bundle.environment}]"
# (Your SDP configuration details go here)
jobs:
lakeflow_ingestion_1:
name: "SQL_Server_Ingest_1_[${bundle.environment}]"
# (Your Lakeflow Connect configuration goes here)
# Define your promotion environments
targets:
dev:
mode: development
default: true
workspace:
host: https://<dev-workspace-url>
stage:
mode: production
workspace:
host: https://<stage-workspace-url>
prod:
mode: production
workspace:
host: https://<prod-workspace-url>
2. Isolate Multi-Target Environments
In the configuration above, you manage your Dev, Stage, and Prod environments as targets. This guarantees structural parity across environments while allowing for dynamic isolation:
Dev (target: dev): Configured for developer agility. Because it is set to mode: development, Databricks automatically prefixes resource names with your username (e.g., [jane_doe] SQL_Server_Ingest_1) so multiple engineers can test simultaneously without conflicts. Data should point to development catalogs in Unity Catalog.
Stage (target: stage): Mirrors production identically but points to pre-production catalogs. This is where automated integration testing happens.
Prod (target: prod): The final destination, pointing strictly to production catalogs and guarded by strict Role-Based Access Control (RBAC).
3. Orchestrate with CI/CD
You can integrate DABs into any standard CI/CD orchestrator (Azure DevOps, GitHub Actions, GitLab CI, etc.) using the Databricks CLI.
A standard release pipeline looks like this:
Pull Request (Dev -> Main): When you create a PR, your CI tool runs databricks bundle validate. This catches syntax errors and structural anomalies before any code is merged.
Continuous Integration (Stage Deployment): Once the PR is merged into the main branch, the pipeline automatically runs databricks bundle deploy -t stage. Automated data tests can run here to verify data quality.
Continuous Deployment (Prod Release): After Stage is validated, the pipeline pauses for a manual approval gate. Once a lead approves, the CI tool runs databricks bundle deploy -t prod, promoting the exact same validated artifacts to Production.
4. Dependency Management
If your pipelines rely on external dependencies (like custom Python wheels, JARs, or mapping files), store them securely inside Unity Catalog Volumes. Reference these volume paths in your bundle configuration rather than embedding large files directly into the workspace.