CertSafari
    Databricks Certified Data Engineer Associate· Lessons

    Domain 5 · Lesson 23/33

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

    Deploy Declarative Automation Bundles

    11 min read
    2.5% of exam
    4 sources
    Published 2 Oct 2026
    Docs as of 30 Sep 2026

    What you will be able to do

    • Run the bundle lifecycle with validate, deploy and run, choosing the environment with -t/--target
    • Explain how a deployment tracks resources and what causes them to be created, updated or removed
    • Contrast development and production deployment modes and decide when to use presets
    • Choose the right deploy flag (--force, --select, --fail-on-active-runs) for a promotion scenario

    1.validate, deploy, run, and choosing a target

    Bundles are deployed with the Databricks CLI. You need CLI version v0.218.0 or above, and the remote workspaces must have workspace files enabled. Workspace files are on by default from Databricks Runtime 11.3 LTS. A new project usually starts from a template with databricks bundle init. You then define settings and resources in databricks.yml, and finally validate, deploy and run.

    Checkpoint 1 of 7· Put it in order

    Put the bundle lifecycle steps in order

    1. 1.Create the project with databricks bundle init
    2. 2.Push the bundle to a workspace with databricks bundle deploy
    3. 3.Start a deployed job or pipeline with databricks bundle run
    4. 4.Define settings and resources in databricks.yml and resource files
    5. 5.Check the configuration with databricks bundle validate

    validate checks the YAML and warns about unknown resource properties. It also prints a summary of the bundle's name, target and workspace. Every command takes -t or --target to pick the environment. If you leave it out, the CLI uses the target marked default: true. Promoting from dev to prod means running the same commands against the same files with a different target.

    Validating, deploying and running against the non-default prod targetbash
    # You must specify "-t prod", because the "dev" target
    # is already set to "default: true":
    databricks bundle validate
    databricks bundle deploy -t prod
    databricks bundle run -t prod hello_job

    Checkpoint 2 of 7· Fill the gap

    dev is the default target. Which flag deploys this bundle to prod?

    # You must specify "-t prod", because the "dev" target
    # is already set to "default: true":
    databricks bundle validate
    databricks bundle deploy  ?  prod
    databricks bundle run -t prod hello_job

    Sources123

    2.What a deployment tracks

    One bundle can be deployed to several workspaces, such as development, staging and production. Each deployment has an identity set by root_path, which defaults to ~/.bundle/${bundle.name}/${bundle.target}. By default, that identity combines the deploying user, the bundle name and the target name. Two deployments with the same three values will interfere with each other.

    The deployment stores the IDs of the resources it created as state in the workspace file system. On each deploy, a resource that is in the configuration but not in the workspace is created. One that exists in both is updated. One that was previously deployed but is no longer in the configuration is removed. Names are not used for matching, so a job in the workspace that happens to have the same name is not taken over by the bundle.

    Checkpoint 3 of 7· Check yourself

    Which change makes a bundle forget its association with a job it deployed earlier?

    Checkpoint 4 of 7· Exam question

    Which top-level mapping in a `databricks.yml` bundle configuration file is required and defines the bundle's name along with settings such as the Databricks CLI version constraint?

    Sources2

    3.Development and production modes

    A target can set mode: development or mode: production. Each mode applies a set of default behaviours in one step. Modes are optional, and a bundle deploys without one. There is no test mode. A test or staging environment is just another target, usually with its own host, variables and possibly presets.

    Marking a target as a development targetyaml
    targets:
      dev:
        mode: development
    What each mode does on databricks bundle deploy -t <target>
    Behaviourmode: developmentmode: production
    Resource namesPrefixed with [dev ${workspace.current_user.short_name}]; jobs and pipelines get a dev tagNot described
    Lakeflow pipelinesMarked development: trueValidated to be development: false
    Schedules and triggersPaused; unpause a job with pause_status: UNPAUSEDNot described
    Cluster override--cluster-id or cluster_id overrides all cluster definitionsOverriding existing cluster definitions is not allowed
    Concurrency and lockingConcurrent runs enabled; deployment lock disabled (re-enable with bundle.deployment.lock.enabled)Not described
    Git and identityNot describedCurrent branch must match git.branch if set; run_as with a service principal recommended

    If production deployments do not run as a service principal, production mode also checks that artifact_path, file_path, root_path and state_path are not overridden to a specific user, and that run_as and permissions are specified. To stop non-admin users from changing deployed assets, and to keep in-progress deployments from affecting running jobs, Databricks suggests deploying to an immutable, read-only folder.

    Checkpoint 5 of 7· Check yourself

    A developer deploys with -t dev, where dev uses mode: development. The job's daily schedule never fires. What is the most likely cause?

    Sources4

    4.Presets and deploy flags for controlled promotion

    Presets let you set individual target behaviours yourself, such as a name prefix, the pipeline development flag, trigger pause status, job concurrency and tags. They are useful when a mode's defaults don't suit an environment, for example a shared test target.

    Custom presets for a dev targetyaml
    targets:
      dev:
        presets:
          name_prefix: 'testing_' # prefix all resource names with testing_
          pipelines_development: true # set development to true for pipelines
          trigger_pause_status: PAUSED # set pause_status to PAUSED for all triggers and schedules
          jobs_max_concurrent_runs: 10 # set max_concurrent runs to 10 for all jobs
          tags:
            department: finance

    A few deploy flags matter when promoting. --force overrides blocking validations, including the production Git branch check. For dashboards, it also overwrites changes made in the workspace since the last deploy. --fail-on-active-runs stops the deploy if any of the bundle's jobs or pipelines are running. --auto-approve skips interactive approvals, which suits non-interactive CI runs. --force-lock takes the deployment lock and should only be used when a crashed deployment has left a stale lock behind. --select deploys only the named resources and their upstream dependencies. Databricks advises using it only for development workspaces.

    Checkpoint 6 of 7· Match them up

    Match each databricks bundle deploy flag to its effect

    Tap a term, then the definition that fits it.

    Checkpoint 7 of 7· Exam question

    A `databricks.yml` file defines a `dev` target with `mode: development` and a `prod` target with `mode: production`. A developer runs `databricks bundle deploy` with no `-t` flag from a workspace where `dev` is marked `default: true`. What happens?

    Sources42

    Exam traps

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

    1. 1.A test environment needs mode: test, and a target cannot deploy without a mode.Why is that wrong?

      Modes are optional, and the documentation describes only development and production. A test or staging environment is simply another target.

      Covered in Development and production modes

    2. 2.A bundle finds existing workspace jobs by name and takes them over on deploy.Why is that wrong?

      Deployments track resources by the IDs stored in their state. Names are never used for matching.

      Covered in What a deployment tracks

    3. 3.--select is a safe way to promote one changed job to production.Why is that wrong?

      --select does not update downstream resources and can cause dependency errors. Databricks restricts it to development workspaces.

      Covered in Presets and deploy flags for controlled promotion

    Practise it for real

    Create a bundle, deploy it to a development target, and run its job from the CLI

    1. 1.Run databricks bundle init and choose a default template

      Why: Templates are the quickest way to get a working databricks.yml with resources and targets

      You should see: A project folder containing databricks.yml at its root

    2. 2.Open databricks.yml and confirm the dev target has mode: development and default: true

      Why: Development mode prefixes names, pauses schedules and marks pipelines as development

      You should see: A targets mapping with a dev entry, plus any other targets the template created

    3. 3.Run databricks bundle validate

      Why: Catches configuration errors and unknown properties, and summarises the name, target and workspace

      You should see: A summary with no errors

    4. 4.Run databricks bundle deploy -t dev

      Why: Creates the bundle's resources in the workspace and records their IDs in deployment state

      You should see: Jobs or pipelines appear in the workspace with the [dev <your short name>] prefix and paused schedules

    5. 5.Run databricks bundle run -t dev <job key from your resources mapping>

      Why: Starts the deployed workflow from the command line

      You should see: A run starts for the deployed job

    Stuck? Get a nudge

    If the deploy prefix doesn't appear, check that you deployed the target that has mode: development.

    Sources

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

    1. 1.
      “You must install the Databricks CLI, version v0.218.0 or above.”
      ↩︎ validate, deploy, run, and choosing a target
      “Finally, validate and deploy your bundle, then run your workflows.”
      ↩︎ Checkpoint
    2. 2.
      “If no command options are specified, the default target as declared within the bundle configuration files is used.”
      ↩︎ validate, deploy, run, and choosing a target
      “specify a configuration profile using the --profile (or -p) flag and do not specify a --target”
      ↩︎ validate, deploy, run, and choosing a target
      “A bundle can be deployed to multiple workspaces, such as development, staging, and production workspaces.”
      ↩︎ What a deployment tracks
      “a bundle's identity is comprised of the identity of the deployer, the bundle's name, and the bundle's target name”
      ↩︎ What a deployment tracks
      “Fail if there are running jobs or pipelines in the deployment.”
      ↩︎ Presets and deploy flags for controlled promotion
      “Resource names are not used to correlate between a bundle deployment and a resource instance”
      ↩︎ Exam trap 2
      “It is not intended for use in production.”
      ↩︎ Exam trap 3
      “If a resource is removed from the bundle configuration, it is removed from the target workspace if it was previously deployed.”
      ↩︎ Prediction
      “A resource's association with a bundle can only be forgotten if you change the bundle name, the bundle target, or the workspace.”
      ↩︎ Checkpoint
      “--force overrides Git branch validation”
      ↩︎ Checkpoint
    3. 3.
      “The databricks bundle validate command returns warnings if unknown resource properties are found in bundle configuration files.”
      ↩︎ validate, deploy, run, and choosing a target
    4. 4.
      “Prepends all resources that are not deployed as files or notebooks with the prefix [dev ${workspace.current_user.short_name}]”
      ↩︎ Development and production modes
      “Validates that the current Git branch is equal to the Git branch that is specified in the target.”
      ↩︎ Development and production modes
      “setting the mode mapping to production does not allow overriding any existing cluster definitions”
      ↩︎ Development and production modes
      “Databricks recommends that you use service principals for production deployments.”
      ↩︎ Development and production modes
      “presets override the default mode behavior, and settings of individual resources override the presets”
      ↩︎ Presets and deploy flags for controlled promotion
      “Deployment modes are optional. You can deploy bundles without setting a mode or configuring presets.”
      ↩︎ Exam trap 1
      “Pauses all schedules and triggers on deployed resources such as jobs or quality monitors.”
      ↩︎ Checkpoint
      “If a schedule is set to UNPAUSED, but the trigger_pause_status preset is set to PAUSED, the schedule will be unpaused.”
      ↩︎ Prediction

    Ready to test yourself?

    Practise the 10 questions on this subdomain.

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