cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
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?

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.