What is the Databricks extension for Visual Studio Code?

The Databricks extension for Visual Studio Code enables you to connect to your remote Databricks workspaces from the Visual Studio Code integrated development environment (IDE) running on your local development machine. You can then:

Note

The Databricks extension for Visual Studio Code supports running R, Scala, and SQL notebooks as automated jobs but does not provide any deeper support for these languages within Visual Studio Code.

Get started

To get started using the Databricks extension for Visual Studio Code:

Create a new Databricks project

Once the extension is installed, you can create a new Databricks project using the Databricks extension for Visual Studio Code:

  1. Launch Visual Studio Code.

  2. Click the Databricks icon in the Visual Studio Code sidebar to open the extension.

  3. Click Create a new project.

  4. In the Command Palette, select a host and authentication method for the project. See Authentication setup for the Databricks extension for Visual Studio Code.

  5. In Provide a path to a folder where you would want your new project to be, enter the path to a folder on your local development computer where you want to create the project, or click Open folder selection dialog and select the path to the project folder.

  6. For Template to use in the Databricks project initialization view, use the up and down arrows to select a project template, and then press Enter. For information about bundle project templates, see Databricks Asset Bundle project templates.

  7. Type a Unique name for this project for the project or leave the default project name of my_project, then pressing Enter.

  8. Choose whether to add a stub (sample) notebook, a stub (sample) Delta Live Tables pipeline, or a stub (sample) Python package to the project, or any combination of these stubs (samples).

  9. Press any key to close the Databricks Project Init editor tab.

  10. For Select the project you want to open, choose the project you just created.

Open an existing Databricks Asset Bundles project

A Databricks Asset Bundles project has a databricks.yml file in the project’s root folder. See Databricks Asset Bundle configuration. If you want to use the extension with an existing Databricks Asset Bundles project:

  1. Launch Visual Studio Code. From the main menu, click File > Open Folder and navigate to the directory that contains your bundle project.

  2. Click the Databricks icon in the Visual Studio Code sidebar to open and begin using features of the extension.

    If the Databricks extension for Visual Studio Code discovers more than one Databricks Asset Bundles project in the current folder, it lets you choose to open a project or create a project configuration file in the root folder.

    Open existing Databricks project
    • If you chose a project, in the Command Palette, select your existing Databricks Asset Bundles project.

    • If you create a configuration in the root folder, that folder becomes a bundle project.

  3. Select a host and authentication method for the project. See Authentication setup for the Databricks extension for Visual Studio Code.

Note

If you open a project created using the Databricks extension for Visual Studio Code v1, migration is attempted automatically using the project’s existing authentication and workspace configuration. The migration button is only available if the automatic migration fails.

Switch between Databricks projects

The Databricks extension for Visual Studio Code allows you to have multiple Databricks projects within your Visual Studio Code workspace and easily switch between them. With your multi-bundle project open in the Visual Studio Code workspace:

  1. Click the Databricks icon in the Visual Studio Code sidebar to open the extension.

  2. Click Local Folder to select the project for the extension to use.

    Local Folder selector

Note

Run actions are only available for files in the active bundle.

Convert a project to a Databricks project

If you have an existing project that you want to convert to a Databricks project:

  1. Launch Visual Studio Code. From the main menu, click File > Open Folder and navigate to your project to open it.

  2. Click the Databricks icon in the Visual Studio Code sidebar to open the extension.

  3. Click Create configuration.

  4. In the Command Palette, select a host and authentication method for the project. See Authentication setup for the Databricks extension for Visual Studio Code.