cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

How to promote Lakeflow Connect and Spark Declarative Pipeline to a higher environment

shan-databricks
Databricks Partner
I have five data ingestion jobs using Lakeflow Connect from SQL Server to Databricks, along with a Spark Declarative Pipeline to load data from bronze to silver.
 
I need guidance on promoting these pipelines and jobs from Dev to Stage and Prod, and how to implement this using CI/CD or any suitable methodology. Please share a practical example.
2 REPLIES 2

balajij8
Contributor III

You can create Bundles - DAB that are decoupled by domain, managed via multi target declarations within configuration and also driven by immutable, versioned artifacts stored securely within Unity Catalog Volumes. You can rely on explicit CI/CD gating and dynamic, scoped resource names rather than monolithic & hardcoded infrastructure definitions.

Bundle Structure & Domain Isolation

  • Decoupled Domain Bundles - You can group configurations into small focused bundles aligned to specific data products or business domains instead of monolithic setup.

  • Shared Lifecycles - Ensure that a single bundle contains only the resources (jobs, pipelines, dashboards) that share a unified deployment lifecycle and ownership domain boundary. More details here

  • Target Definitions - You can maintain all target definitions (dev, uat, prod) within a single yml per bundle to guarantee environmental structural parity. More details here

Multi-Target Environment Strategy

  • Development - Configure for feature-branch agility. Implement dynamic resource renaming using built-in metadata expressions (such as ${workspace.current_user.short_name}) to enforce isolation within shared or personal workspaces. Route all computation to development catalogs and schemas.

  • Staging/User Acceptance Testing - Trigger automated deployments on pull request merges to the main branch. This layer must run full integration suites and validation workflows against pre-production catalogs, mirroring production configurations identically.

  • Production - Guard production workloads with manual approval workflows and strict role-based access control (RBAC) with the target production Unity Catalog environments.

CI/CD Orchestration (Azure DevOps)

  • Pull Request Verification - Enforce static analysis by running databricks bundle validate prior to any code merges to catch syntactical and structural anomalies early.

  • Continuous Deployment (UAT) - Compile code, version artifacts, stage them directly into Unity Catalog volumes and execute target-specific deployments sequentially.

  • Release Management (Prod) - Restrict production deployments to manual approval gates within Azure DevOps Environments. Re-use the identical, immutable artifacts verified in UAT to eliminate drift.

  • Dev to Stage - Code Push to main branch can trigger deployment to Stage/QA
  • Stage to Prod - After successful Stage deployment, you can trigger Prod deployment after manual approval.

Artifact & Dependency Management

  • Unity Catalog Volumes - Store external dependencies (Python Wheels, JARs) inside secure, governed Unity Catalog Volumes rather than embedding large binaries directly into the bundle workspace.

  • Inter-Bundle Governance - Model complex cross-bundle dependencies explicitly within Azure DevOps YAML pipeline tasks rather than nesting configuration files. Fail pipeline execution immediately if upstream assets are absent.

Lakeflow - More details here

SDP - More details here

aliyasingh
New Contributor III

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:

YAML
 
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:

  1. 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.

  2. 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.

  3. 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.