Κοινή χρήση μέσω


What is the Databricks extension for Visual Studio Code?

The Databricks extension for Visual Studio Code enables you to connect to your remote Azure 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 Databricks 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.

Migrate a project to a Databricks project

If you have an existing project you want to migrate to a Databricks project, open it with the Databricks extension for Visual Studio Code to begin migration:

  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 Migrate to a Databricks 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.

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.

Open an existing Databricks Asset Bundles project

If the Databricks extension for Visual Studio Code discovers more than one Databricks Asset Bundles project in the current folder, the Databricks extension for Visual Studio Code allows you to choose which project to open.

Note

A Databricks Asset Bundles project has a databricks.yml file in the project’s root folder. See Databricks Asset Bundle configuration.

  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 the extension.

  3. Click Open existing Databricks Project.

    Open existing Databricks project

  4. In the Command Palette, select your existing Databricks Asset Bundles project.

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

Add another Databricks project to the workspace

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. To add another project:

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

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

  3. Click Active Workspace Folder to select the project for the extension to use.

    Active Workspace Folder selector