CertSafari
    Databricks Certified Data Engineer Professional· Lessons

    Domain 1 · Lesson 1/46

    Bundle project structure: databricks.yml, include, and targets

    Implement scalable Python project structures for Declarative Automation Bundles (formerly Databricks Asset Bundles / DABs) to support modular development and CI/CD integration.

    10 min read
    1.92% of exam
    4 sources
    Published 3 Oct 2026
    Docs as of 30 Sep 2026

    What you will be able to do

    • Explain what a Declarative Automation Bundle (formerly Databricks Asset Bundle) contains and when it fits a project
    • Lay out a bundle with one root databricks.yml, split resource files, src/ and tests/
    • Use targets and deployment modes so one bundle deploys to dev and prod
    • Order the CLI lifecycle (init, validate, deploy, run) as a CI/CD pipeline would run it

    Key concept

    Bundle as the project's single deployable definition — A bundle keeps source code, tests, and YAML definitions of jobs and pipelines in one versioned project. The Databricks CLI validates and deploys that whole project to a chosen target workspace. Every structural choice in the project serves this one unit of deployment.

    1.What a bundle is and why it exists

    Declarative Automation Bundles were previously called Databricks Asset Bundles (DABs). They bring source control, code review, testing and CI/CD to data and AI projects. A bundle puts metadata next to your project's source files, so Databricks resources such as jobs and pipelines are described as files that live in the repository. The documentation calls this an infrastructure-as-code (IaC) approach. Bundles fit best when a project has many contributors, needs automation, and must have CI/CD.

    A bundle has four kinds of content. First, the cloud infrastructure and workspace configuration it needs. Second, source files such as notebooks and Python files that hold the business logic. Third, definitions of resources: Lakeflow Jobs, Lakeflow pipelines, dashboards, Model Serving endpoints and MLflow objects. Fourth, unit and integration tests. All of this is deployed as one unit. That is why the project's structure matters: it is the structure of what gets shipped.

    Checkpoint 1 of 5· Check yourself

    A bundle project contains source files, resource definitions and tests. How is it deployed to a target environment?

    Sources1

    2.databricks.yml: the one required root file

    databricks.yml is the main configuration file. The smallest valid version contains the required bundle mapping with a name, plus one target to deploy to.

    The simplest databricks.yml: a bundle name plus one default targetyaml
    bundle:
      name: my_bundle
    
    targets:
      dev:
        default: true

    The full specification lists more top-level keys. The table shows the ones that shape a scalable project. Settings under artifacts, resources and workspace are defaults, and a target can override them.

    Top-level databricks.yml mappings that shape project structure
    MappingWhat it holds
    bundleRequired; the bundle name (also git origin_url / branch, deployment settings)
    includeAdditional configuration files or path globs to pull in
    artifactsBuild settings for artifacts such as a whl (build, path, type)
    variablesCustom variables used throughout the bundle
    resourcesDefinitions of jobs, pipelines, schemas, volumes, dashboards and more
    run_asThe user_name or service_principal_name the bundle runs as
    targetsPer-environment overrides: mode, workspace, resources, variables, presets

    To make the configuration modular, keep databricks.yml short and split the rest into separate files. The documentation's example keeps the bundle name and an include glob in databricks.yml. The job definition goes in its own file, and the targets go in another.

    Splitting configuration: databricks.yml includes every .yml file in the folderyaml
    # databricks.yml
    
    bundle:
      name: hello-bundle
    
    include:
      - '*.yml'

    Checkpoint 2 of 5· Fill the gap

    Which top-level mapping makes this databricks.yml pull in the separate job and target files?

    bundle:
      name: hello-bundle
    
     ? :
      - '*.yml'

    Sources2

    3.The template layout: resources/, src/, tests/

    Projects usually start from a template rather than an empty folder. Running databricks bundle init offers Databricks-provided templates and asks questions to fill in project variables. Teams can also write custom templates that include default permissions, service principals and CI/CD configuration, so every new project starts with the same standards.

    Starting a bundle from a templatebash
    databricks bundle init

    The default-python template creates a layout that keeps configuration, code and tests apart. databricks.yml sets the bundle name, references the bundle's files, holds the whl build settings, defines catalog and schema variables, and configures the target workspaces. Each resource has its own file under resources/, for example resources/sample_job.job.yml for the job's settings. src/ holds the code that is built into the Python wheel, and tests/ holds sample unit tests.

    Checkpoint 3 of 5· Exam question

    A team maintains a Declarative Automation Bundle for a Lakeflow pipeline and two Lakeflow Jobs. As the project grows, they want to define each job and pipeline in its own YAML file under a `resources/` folder while keeping every definition active in one bundle deployment. Which approach correctly wires these separate resource files into `databricks.yml`?

    Sources31

    4.Targets and deployment modes: one bundle, many environments

    The targets mapping lets the same source deploy to development and production. A target sets only what is different in its environment. Anything it does not override comes from the top-level resources mapping. In the example below, prod points to a different workspace host and cluster. It does not repeat the notebook_task.

    A prod target overriding only the workspace host and cluster IDyaml
    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 host over default where possible, because host makes configuration more portable. The CLI finds a matching profile in .databrickscfg. If more than one profile matches, you pass --profile. Only one target can be the default.

    A target can also set a deployment mode. Modes are optional and apply a group of common settings at once. Development mode prefixes deployed resources with [dev ${workspace.current_user.short_name}], marks pipelines as development: true, allows concurrent job runs and turns off the deployment lock. Production mode checks that pipelines are development: false. It also checks that the current Git branch matches the branch set in the target, and --force overrides that check.

    Marking a target as a development targetyaml
    targets:
      dev:
        mode: development

    Checkpoint 4 of 5· Check yourself

    A CI job deploys the prod target, which is set to mode: production and configures git: branch: main. The deploy runs from a feature branch. What happens?

    Sources24

    5.The CLI lifecycle and CI/CD

    Bundles are a feature of the Databricks CLI, and all of their CI/CD use goes through it. The lifecycle is: create the bundle (usually with bundle init), develop it by defining settings and resources in databricks.yml and the resource files, then validate, deploy and run. If dev is the default target you can leave out -t dev. Any other target must be named, for example databricks bundle deploy -t prod.

    Checkpoint 5 of 5· Put it in order

    Put the bundle lifecycle steps in order, as a CI/CD pipeline would run them

    1. 1.databricks bundle run -t <target> <job>
    2. 2.databricks bundle init to create the project from a template
    3. 3.databricks bundle deploy -t <target>
    4. 4.databricks bundle validate
    5. 5.Define settings and resources in databricks.yml and resource files

    These commands do not depend on an IDE, so a CI system can run them. The documentation describes starting a bundle deployment from a GitHub CI/CD workflow. For production deployments, Databricks recommends service principals, which you enforce by setting run_as to a service principal.

    Sources14

    Exam traps

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

    1. 1.Each sub-folder or team in a large project can have its own databricks.yml that the CLI merges.Why is that wrong?

      There is exactly one databricks.yml, at the bundle root. Other YAML files are brought in through the include mapping.

      Covered in databricks.yml: the one required root file

    2. 2.A target must repeat the full job definition, including notebook_task, or the deployed job will be missing it.Why is that wrong?

      A target overrides only what it declares. Undeclared settings come from the top-level resources mapping.

      Covered in Targets and deployment modes: one bundle, many environments

    3. 3.Production mode's Git branch check cannot be bypassed, so a hotfix from another branch can never be deployed.Why is that wrong?

      The branch check is real, but you can override it by passing --force when you deploy.

      Covered in Targets and deployment modes: one bundle, many environments

    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 is and why it exists
      “Your bundle project's collection of source files and metadata is deployed as a single bundle to your target environment.”
      ↩︎ What a bundle is and why it exists
      “Set organizational standards for new projects by authoring custom bundle templates that include default permissions, service principals, and CI/CD configurations.”
      ↩︎ The template layout: resources/, src/, tests/
      “Kick off a bundle deployment as part of a CI/CD (continuous integration/continuous deployment) workflow in GitHub.”
      ↩︎ The CLI lifecycle and CI/CD
      “Declarative Automation Bundles are a feature of the Databricks CLI.”
      ↩︎ The CLI lifecycle and CI/CD
      “Ultimately a bundle is an end-to-end definition of a project, including how the project should be structured, tested, and deployed.”
      ↩︎ Key concept
      “Finally, validate and deploy your bundle, then run your workflows.”
      ↩︎ 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 required root file
      “For more modularization and better reuse of definitions and settings across bundles, split your bundle configuration into separate files:”
      ↩︎ databricks.yml: the one required root file
      “Databricks recommends that you use the host mapping instead of the default mapping wherever possible, as this makes your bundle configuration files more portable.”
      ↩︎ Targets and deployment modes: one bundle, many environments
      “but it can reference other configuration files, such as resource configuration files, in the include mapping.”
      ↩︎ Exam trap 1
      “it falls back to use the notebook_task mapping within the top-level resources mapping”
      ↩︎ Exam trap 2
      “A bundle must contain one (and only one) configuration file named databricks.yml at the root of the bundle project folder.”
      ↩︎ Prediction
    3. 3.
      “resources/sample_job.job.yml: This file specifies the Python wheel job's settings.”
      ↩︎ The template layout: resources/, src/, tests/
      “tests/: This folder contains sample unit tests.”
      ↩︎ The template layout: resources/, src/, tests/
    4. 4.
      “Marks all related deployed Lakeflow pipelines as development: true.”
      ↩︎ Targets and deployment modes: one bundle, many environments
      “Databricks recommends that you use service principals for production deployments.”
      ↩︎ The CLI lifecycle and CI/CD
      “This validation can be overridden by specifying --force while deploying.”
      ↩︎ Exam trap 3
      “Validates that the current Git branch is equal to the Git branch that is specified in the target.”
      ↩︎ Checkpoint

    Continue to page 2 of 2

    Python code in bundles: wheel artifacts, library dependencies, and Python-defined resources

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