cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Databricks Asset Bundle (DAB) from existing workspace?

dbx_687_3__1b3Q
New Contributor III

Can anyone point us to some documentation that explains how to create a DAB from an EXISTING workspace? We've been building pipelines, notebooks, tables, etc in a single workspace and a DAB seems like a great way to deploy it all to our Test and Production environments. All the documentation and videos I found so far demonstrate creating a new DAB from inside VSCode. Is our use case currently supported by asset bundles?

1 ACCEPTED SOLUTION

Accepted Solutions

Kaniz
Community Manager
Community Manager

Hi @dbx_687_3__1b3Q , 

 

Yes, you can create a Databricks Asset Bundle (DAB) from an existing workspace that contains pipelines, notebooks, tables, and other Databricks assets.

To create a DAB from an existing workspace, you can use the Databricks CLI and follow these steps:

  1. Install the Databricks CLI and authenticate with your Databricks workspace. For detailed instructions, see Databricks CLI Quickstart.

  2. Using the command, export your desired assets as a Databricks Archive (DBA) file. For example, the following command exports a notebook named my_notebook to a DBA file named my_archive.dbc

databricks workspace export --format dbc --path "/Users/my_username/my_notebook" --output my_archive.dbc
  1. Create a Databricks Asset Bundle (DAB) by using the databricks bundles create command. You can specify the name and version of the bundle and the DBA file created in step 2. For example, the following command creates a DAB named my_bundle version 1.0.0 using the DBA file my_archive.dbc:
databricks bundles create --name my_bundle --version 1.0.0 my_archive.dbc
  1. Deploy the DAB to your target environment using the databricks bundles deploy command. You can specify the domain and version to deploy. For example, the following command deploys version 1.0.0  my_bundle to the test environment:
databricks bundles deploy --environment test --version 1.0.0 my_bundle

Note that you need the appropriate permissions to deploy bundles in your target workspace.

For more information about creating and deploying Databricks Asset Bundles using the Databricks CLI, see Databricks CLI and Bundles.

 

View solution in original post

2 REPLIES 2

Kaniz
Community Manager
Community Manager

Hi @dbx_687_3__1b3Q , 

 

Yes, you can create a Databricks Asset Bundle (DAB) from an existing workspace that contains pipelines, notebooks, tables, and other Databricks assets.

To create a DAB from an existing workspace, you can use the Databricks CLI and follow these steps:

  1. Install the Databricks CLI and authenticate with your Databricks workspace. For detailed instructions, see Databricks CLI Quickstart.

  2. Using the command, export your desired assets as a Databricks Archive (DBA) file. For example, the following command exports a notebook named my_notebook to a DBA file named my_archive.dbc

databricks workspace export --format dbc --path "/Users/my_username/my_notebook" --output my_archive.dbc
  1. Create a Databricks Asset Bundle (DAB) by using the databricks bundles create command. You can specify the name and version of the bundle and the DBA file created in step 2. For example, the following command creates a DAB named my_bundle version 1.0.0 using the DBA file my_archive.dbc:
databricks bundles create --name my_bundle --version 1.0.0 my_archive.dbc
  1. Deploy the DAB to your target environment using the databricks bundles deploy command. You can specify the domain and version to deploy. For example, the following command deploys version 1.0.0  my_bundle to the test environment:
databricks bundles deploy --environment test --version 1.0.0 my_bundle

Note that you need the appropriate permissions to deploy bundles in your target workspace.

For more information about creating and deploying Databricks Asset Bundles using the Databricks CLI, see Databricks CLI and Bundles.

 

RyHubb
New Contributor III

The Last link posted no longer works. Also, the commands seem to have changed in the Databricks CLI. I see no `bundles` command, only `bundle`....and that command has no `create` option. Is there no way to convert a dbc file to a bundle any more?

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!