Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
To help you get started using Databricks Asset Bundles in the workspace, this tutorial walks you through creating a bundle with a job, deploying it, and running the job in the bundle - all from the workspace.
For requirements for using bundles in the workspace, see Databricks Asset Bundles in the workspace requirements.
For more information about bundles, see What are Databricks Asset Bundles?.
Create a bundle
First, create a bundle in the Databricks workspace:
Navigate to the Git folder where you want to create your bundle.
Tip
If you have previously opened the Git folder in the editor in the workspace, you can use the workspace browser authoring contexts menu to quickly navigate to the Git folder. See Authoring contexts.
Click the Create button, then click Asset bundle. Alternatively, right click on the Git folder or its associated kebab in the workspace tree and click Create > Asset bundle:

In the Create an asset bundle dialog, give the asset bundle a name, such as totally-awesome-bundle. The bundle name can only contain letters, numbers, dashes, and underscores. Select Empty project then click Create and deploy .

This creates an initial bundle in the Git folder, which includes a .gitignore Git configuration file and the required Databricks Asset Bundles databricks.yml file. The databricks.yml file contains the main configuration for the bundle. For details, see Databricks Asset Bundle configuration.

Add a notebook
Next, add a notebook to your bundle. The notebook in the following example prints “Hello World!”.
Click the Add notebook bundle project tile. Alternatively, click the kebab for the bundle in the table of contents, and then click Create > Notebook.
Rename the notebook to helloworld.
Set the language of the notebook to Python and paste the following into the cell of the notebook:
print("Hello World!")
Define a job
Now define a job that runs the notebook.
Click the deployment icon for the bundle to switch to the Deployments panel.

In the Bundle resources section, click Add, then New job definition.

Type run-notebook into the Job name field of the Add job to existing bundle dialog. Click Add and deploy.
A Deploy to dev confirmation dialog appears with information about the job resource that will be created in the dev target workspace. Click Deploy.
Navigate back to the bundle's files by clicking the folder icon above the deployments icon. A job resource
run-notebook.job.ymlwas created with basic YAML for the job and some additional commented-out example job task YAML.Add a notebook task to the job definition. Replace the example YAML in the
run-notebook.job.ymlfile with the following:resources: jobs: run_notebook: name: run-notebook queue: enabled: true tasks: - task_key: my-notebook-task notebook_task: notebook_path: ../helloworld.ipynb
For details about defining a job in YAML, see job. For YAML syntax for other supported job task types, see Add tasks to jobs in Databricks Asset Bundles.
Deploy the bundle
Next, deploy the bundle and run the job that contains the helloworld notebook task.
In the Deployments pane for the bundle under Targets, click the dropdown to select the
devtarget workspace if it is not already selected. Target workspaces are defined in thetargetsmapping of the bundle’sdatabricks.yml. See Databricks Asset Bundle deployment modes.
Click the Deploy button. The bundle is validated and details of the validation appear in a dialog.
Review the deployment details in this Deploy to dev confirmation dialog, then click Deploy.

Important
Deploying bundles and running bundle resources executes code as the current user. Make sure that you trust the code in the bundle, including YAML, which can contain configuration settings that run commands.
The status of the deployment is output to the Project output window.
Run the job
Deployed bundle resources are listed under Bundle resources. Click the play icon associated with the job resource to run it.

Navigate to Job runs from the left navigation bar to see the bundle run. The name of the bundle job run is prefixed, for example [dev someone] run-notebook.