bundle command group

Note

This information applies to Databricks CLI versions 0.100 and higher, which are in Private Preview. To try them, reach out to your Databricks contact. To find your version of the Databricks CLI, run databricks -v.

The bundle command group within the Databricks CLI enables you to programmatically validate, deploy, and run Databricks workflows such as Databricks jobs, Delta Live Tables pipelines, and MLOps stacks. See What are Databricks application bundles?

Important

Before you use the Databricks CLI, be sure to set up the Databricks CLI and set up authentication for the Databricks CLI.

You run bundle commands by appending them to databricks bundle. To display help for the bundle command, run databricks bundle -h.

Generate the bundle settings schema

To display the Databricks application bundle settings schema, run the bundle schema command, as follows:

databricks bundle schema

To generate the Databricks application bundle settings schema as a JSON file, run the bundle schema command and redirect the output to a JSON file. For example, you can generate a file named bundle_config_schema.json within the current directory, as follows:

databricks bundle schema > bundle_config_schema.json

Validate a bundle

To validate that your bundle settings files are syntactically correct, run the bundle validate command from the same directory as the bundle settings files, as follows:

databricks bundle validate

Sync a bundle’s tree to a workspace

Use the bundle sync command to do one-way synchronization of a bundle’s file changes within a local filesystem directory, to a directory within a remote Databricks workspace.

Note

bundle sync commands cannot synchronize file changes from a directory within a remote Databricks workspace, back to a directory within a local filesystem.

databricks bundle sync commands work in the same way as databricks bundle commands and are provided as a productivity convenience. For command usage information, see sync command group.

Deploy a bundle

To deploy any specified local artifacts to the remote workspace, run the bundle deploy command from the same directory as the bundle settings files (which is also known as the bundle root). If no command options are specified, the default environment as declared within the bundle settings files is used, as follows:

databricks bundle deploy

Tip

You can run databricks bundle commands outside of the bundle root. If so, you can specify the bundle root path by setting the BUNDLE_ROOT environment variable. If this environment variable is not set, databricks bundle commands attempt to find the bundle root by searching within the current working directory.

To deploy the artifacts within the context of a specific environment, specify the -e (or --environment) option along with the environment’s name as declared within the bundle settings files. For example, for an environment declared with the name development, run the following command:

databricks bundle deploy -e development

Run a bundle

To run a specific job or pipeline, run the bundle run command from the same directory as the bundle settings files. You must specify the job or pipeline declared within the bundle settings files. If the -e (or --environment) option is not specified, the default environment as declared within the bundle settings files is used. For example, to run a job named hello_job within the context of the default environment, run the following command:

databricks bundle run hello_job

To run a job named hello_job within the context of an environment declared with the name development, run the following command:

databricks bundle run -e development hello_job

Destroy a bundle

To delete jobs, pipelines, and artifacts that were previously deployed, run the bundle destroy command from the same directory as the bundle settings files. The following command deletes all previously-deployed jobs, pipelines, and artifacts that are defined in the bundle settings files:

databricks bundle destroy

By default, you are prompted to confirm permanent deletion of the previously-deployed jobs, pipelines, and artifacts. To skip these prompts and perform automatic permanent deletion, add the --auto-approve option to the bundle destroy command.