CertSafari
    Databricks Certified Data Engineer Associate· Lessons

    Domain 5 · Lesson 23/33

    Declarative Automation Bundles: databricks.yml, Targets, Overrides and Variables

    Deploy Declarative Automation Bundles

    10 min read
    2.5% of exam
    5 sources
    Published 2 Oct 2026
    Docs as of 30 Sep 2026

    What you will be able to do

    • Explain what a Declarative Automation Bundle packages and why it is used for CI/CD
    • Structure a databricks.yml with resources, include and targets mappings
    • Predict how target settings merge with or override top-level job and pipeline settings
    • Use custom variables and per-target values to configure dev, test and prod

    Key concept

    Bundle (Declarative Automation Bundle) — A bundle is a project's source code plus YAML that defines its Databricks resources, such as Lakeflow Jobs and pipelines. The whole thing is deployed as one unit to a named target environment. Promoting the project means deploying the same bundle to a different target.

    1.What a bundle packages

    Declarative Automation Bundles were formerly called Databricks Asset Bundles, and you will still see both names. They bring software engineering practice to Databricks projects: source control, code review, testing and CI/CD. Without bundles, you create a job in the UI and its definition stays in the workspace. With a bundle, the job definition is a YAML file in the same repository as the notebooks it runs. It is versioned and reviewed with that code, and deployed with it.

    According to the documentation, a bundle contains four kinds of things: the cloud infrastructure and workspace configuration it needs; source files such as notebooks and Python files that hold the business logic; definitions and settings for Databricks resources; and unit and integration tests. The resource types listed include Lakeflow Jobs, Lakeflow pipelines, dashboards, Model Serving endpoints, MLflow experiments and MLflow registered models. Databricks describes bundles as an infrastructure-as-code (IaC) approach. They fit best on complex projects with several contributors, where automation and CI/CD are required.

    Bundles are a feature of the Databricks CLI. You write the YAML, then use the CLI to validate it, deploy it to a remote workspace and run the deployed workflows. You can also work with bundles directly in the workspace, which does not require installing the CLI.

    Checkpoint 1 of 5· Check yourself

    A team wants its Lakeflow Job and Lakeflow pipeline definitions to live next to the notebooks they run and be deployed with them. What does a bundle provide?

    Sources1

    2.databricks.yml: the one root configuration file

    Every bundle has exactly one file named databricks.yml at the root of the project folder. That file defines the bundle. It can pull in other YAML files, such as one file per job or pipeline, through the include mapping. The smallest valid configuration has a bundle name, which is required, and one target.

    The simplest databricks.yml: a required bundle name and a default dev targetyaml
    bundle:
      name: my_bundle
    
    targets:
      dev:
        default: true

    Lakeflow Jobs go under resources.jobs and Lakeflow pipelines go under resources.pipelines. Each one is keyed by a programmatic identifier that you choose. Other workspace assets have their own keys under resources, including dashboards, schemas, volumes, experiments and model_serving_endpoints. The other top-level mappings set defaults, and each target can override them.

    Main top-level mappings in databricks.yml
    MappingWhat it holds
    bundleRequired. The bundle name (required), plus optional settings such as cluster_id, deployment and git
    includeGlobs for extra configuration files, such as resource files, to merge into the bundle
    variablesCustom variables used throughout the bundle, each with a description and default
    workspacehost, profile, root_path and other workspace settings, unless a target overrides them
    resourcesDefinitions of jobs, pipelines, dashboards, schemas, volumes and other resources
    run_as / permissionsThe identity that runs the bundle, and permissions applied to its resources
    targetsNamed deployment environments with default, mode, presets and per-target overrides

    Checkpoint 2 of 5· Check yourself

    A project keeps its job definition in jobs.yml and its pipeline definition in pipelines.yml. How do these files become part of the bundle?

    Sources23

    3.Targets: one definition, environment-specific overrides

    The targets mapping is how one bundle serves dev, test and prod. Each target is a named environment. Settings at the top level are the defaults. Settings inside a target are applied on top of those defaults when you deploy to that target. In the example below, prod points at a different workspace host and swaps the cluster ID. It does not repeat the notebook_task, because anything a target leaves out falls back to the top-level definition.

    A prod target that changes the workspace host and cluster ID; everything else comes from the top-level jobyaml
    targets:
      dev:
        default: true
      prod:
        workspace:
          host: https://<production-workspace-url>
        resources:
          jobs:
            hello-job:
              name: hello-job
              tasks:
                - task_key: hello-task
                  existing_cluster_id: 2345-678901-fabcd456

    Databricks recommends setting a host for each target rather than relying on the default mapping alone, because it makes the configuration more portable. When a host is set, the CLI looks for a profile with that host in your .databrickscfg file and uses it to authenticate.

    Top-level and target job cluster settings joined on job_cluster_keyyaml
    resources:
      jobs:
        my-job:
          name: my-job
          job_clusters:
            - job_cluster_key: my-cluster
              new_cluster:
                spark_version: 13.3.x-scala2.12
    
    targets:
      development:
        resources:
          jobs:
            my-job:
              name: my-job
              job_clusters:
                - job_cluster_key: my-cluster
                  new_cluster:
                    node_type_id: i3.xlarge
                    num_workers: 1

    The rule is to merge first, then let the target win on conflicts. If spark_version and num_workers were set at both levels, the target's values would replace the top-level ones, while node_type_id from the top level would remain. Each kind of setting has its own join key. Job clusters join on job_cluster_key, job tasks on task_key, and Lakeflow pipeline clusters on label (default or maintenance). Artifacts follow the same pattern: an artifact setting defined in a target takes precedence over the top-level one.

    Checkpoint 3 of 5· Match them up

    Match each key to the settings it joins between the top-level resources mapping and a target

    Tap a term, then the definition that fits it.

    Sources42

    4.Custom variables for per-environment values

    Overriding whole resource blocks works, but often only one value changes between environments, such as a cluster ID or a notebook path. Custom variables handle this. You declare them in the variables mapping or in a variable-overrides.json file, give each a description and an optional default, and reference them anywhere in the configuration.

    Declaring two custom variables with defaultsyaml
    variables:
      my_cluster_id:
        description: The ID of an existing cluster.
        default: 1234-567890-abcde123
      my_notebook_path:
        description: The path to an existing notebook.
        default: ./hello.py

    To use a variable, write ${var.my_cluster_id}. To give a target its own value, set it under that target's variables mapping. The configuration specification shows this as <defined-variable-name>: <non-default-value> # value for this target. Bundles also provide built-in substitutions, such as ${bundle.target}, ${bundle.name}, ${workspace.host} and ${workspace.current_user.short_name}, so names and paths can include the environment or the deploying user.

    Checkpoint 4 of 5· Check yourself

    A job task needs the cluster ID held in the custom variable my_cluster_id. Which reference is correct?

    Checkpoint 5 of 5· Exam question

    A data engineering team keeps a Lakeflow Job and a Lakeflow Spark Declarative Pipeline defined as source in a repository, and wants to promote the exact same resource definitions from a dev workspace to a prod workspace without hand-editing settings in the UI at each stage. Which capability of Declarative Automation Bundles addresses this directly?

    Sources52

    Exam traps

    Each one states something that sounds right. Open it to see what is actually true.

    1. 1.Defining new_cluster under a target replaces the entire top-level new_cluster block.Why is that wrong?

      Settings with the same join key are merged. The target value wins only for a field defined at both levels, and fields defined only at the top level are kept.

      Covered in Targets: one definition, environment-specific overrides

    2. 2.Each subfolder of a bundle can have its own databricks.yml for its jobs or pipelines.Why is that wrong?

      A bundle has exactly one databricks.yml, at the project root. Other YAML files are added through the include mapping.

      Covered in databricks.yml: the one root configuration file

    Sources

    Every claim above is drawn from one of these pages, quoted as it was written on the date shown.

    1. 1.
      “Declarative Automation Bundles are an infrastructure-as-code (IaC) approach to managing your Databricks projects.”
      ↩︎ What a bundle packages
      “Definitions and settings for Databricks resources, such as Lakeflow Jobs, Lakeflow pipelines, Dashboards, Model Serving endpoints, MLflow Experiments, and MLflow registered models”
      ↩︎ What a bundle packages
      “Your bundle project's collection of source files and metadata is deployed as a single bundle to your target environment.”
      ↩︎ Key concept
      “make it possible to describe Databricks resources such as jobs and pipelines as source files”
      ↩︎ Checkpoint
    2. 2.
      “The simplest databricks.yml defines the bundle name, which is a required top-level mapping, and a target deployment.”
      ↩︎ databricks.yml: the one root configuration file
      “it falls back to use the notebook_task mapping within the top-level resources mapping”
      ↩︎ Targets: one definition, environment-specific overrides
      “Setting the host mapping instructs the Databricks CLI to find a matching profile in your .databrickscfg file”
      ↩︎ Targets: one definition, environment-specific overrides
      “<defined-variable-name>: <non-default-value> # value for this target”
      ↩︎ Custom variables for per-environment values
      “A bundle must contain one (and only one) configuration file named databricks.yml at the root of the bundle project folder.”
      ↩︎ Exam trap 2
      “it can reference other configuration files, such as resource configuration files, in the include mapping”
      ↩︎ Checkpoint
    3. 3.
      “allows you to specify information about the Databricks resources used by the bundle in the resources mapping in the bundle configuration”
      ↩︎ databricks.yml: the one root configuration file
    4. 4.
      “then the setting in the targets mapping takes precedence over the setting in the top-level resources mapping”
      ↩︎ Targets: one definition, environment-specific overrides
      “spark_version in the top-level resources mapping is combined with node_type_id and num_workers in the resources mapping in targets”
      ↩︎ Exam trap 1
      “spark_version in the top-level resources mapping is combined with node_type_id and num_workers in the resources mapping in targets”
      ↩︎ Prediction
      “For Lakeflow pipelines, use label within the cluster settings of a pipeline definition”
      ↩︎ Checkpoint
    5. 5.
      “Custom variables are declared in your bundle configuration files within the variables mapping or in a variable-overrides.json file.”
      ↩︎ Custom variables for per-environment values
      “To reference a custom variable within your bundle configuration, use the variable substitution ${var.<variable_name>}.”
      ↩︎ Checkpoint

    Continue to page 2 of 2

    Deploying Bundles to Dev, Test and Prod with the Databricks CLI

    Spotted a mistake, or was something unclear? Tell us.