A data engineering team deploys a Declarative Automation Bundle from an automated CI/CD pipeline that uses the Databricks CLI. The databricks.yml file defines two targets: dev, which is the default target, and production.
The pipeline step must meet these requirements:
- Deploy the bundle to the
productiontarget. - Run without stopping at any confirmation prompt.
- If a job or pipeline from the bundle is currently running, the deployment must fail instead of disrupting the run.
Which command should the pipeline step run?
Because production is not the default target, the command must name it with -t. Automated CI/CD deployments add --auto-approve so the CLI does not wait for confirmation, and --fail-on-active-runs makes the deployment fail rather than disrupt jobs or pipelines that are currently running. Only one option combines all three.
- Not correct:
databricks bundle deploy --auto-approve --fail-on-active-runs. Without-t, deployment uses the default target defined in the bundle configuration, which here isdev, notproduction. - Correct:
databricks bundle deploy -t production --auto-approve --fail-on-active-runs.-t productionselects the non-default target,--auto-approveskips confirmation prompts for automated runs, and--fail-on-active-runsmakes the deployment fail when it finds active runs. - Not correct:
databricks bundle deploy -t production --auto-approve --force-lock. Without--fail-on-active-runs, the deployment does not fail when bundle jobs or pipelines are running, so it can disrupt them. - Not correct:
databricks bundle deploy -t production --force-lock --fail-on-active-runs.--force-lockoverrides a deployment lock; it does not skip confirmation prompts. Only--auto-approvedoes that, so the step could still stop at a prompt.