Install the Databricks extension for Visual Studio Code

This article describes how to install and open the Databricks extension for Visual Studio Code, and then configure a project for the extension to use. See What is the Databricks extension for Visual Studio Code?.

Note

If you have already completed the VSCode extension for Databricks tutorial: Run Python on a cluster and as a job, you have already installed the Databricks extension for Visual Studio Code. Skip ahead to Authentication setup for the Databricks extension for Visual Studio Code.

Requirements

You must have at least one Databricks workspace available, and the workspace must meet the following requirements:

  • The workspace must contain at least one Databricks cluster. If you do not have a cluster available, you can create a cluster now or after you install the Databricks extension for Visual Studio Code.

Note

Databricks recommends that you create a Personal Compute cluster. This enables you to start running workloads immediately, minimizing compute management overhead.

Databricks SQL warehouses are not supported by this extension.

You must have the following on your local development machine:

Install and open the extension

Note

The following procedure uses the Databricks extension for Visual Studio Code, version 1, which is generally available. To complete this procedure for the Databricks extension for Visual Studio Code, version 2, currently in Private Preview, skip ahead to Install and open the Databricks extension for Visual Studio Code, version 2.

  1. In Visual Studio Code, open the Extensions view (View > Extensions from the main menu).

  2. In Search Extensions in Marketplace, enter Databricks.

  3. Click the Databricks entry.

    Note

    There are several entries with Databricks in their titles. Be sure to click the one with only Databricks in its title and a blue check mark icon next to Databricks.

  4. Click Install.

  5. Click Reload Required, or restart Visual Studio Code.

  6. Open the extension: on the sidebar, click the Databricks icon.

  7. Set up authentication between the Databricks extension for Visual Studio Code and your Databricks workspace. See Authentication setup for the Databricks extension for Visual Studio Code.

Install and open the Databricks extension for Visual Studio Code, version 2

Note

The Databricks extension for Visual Studio Code, version 2 is in Private Preview.

Install the Visual Studio Code extension
  1. In the Visual Studio Code sidebar, click the Extensions icon.

  2. In Search Extensions in Marketplace, enter Databricks.

  3. In the entry labeled Databricks with the subtitle IDE support for Databricks by Databricks, click the down arrow next to Install, and then click Install Pre-Release Version.

    Note

    If version 1 of the extension is already installed, click the entry labeled Databricks, and then click Switch to Pre-Release Version instead.

  4. Do one of the following:

    • If you have not yet accepted the terms and conditions regarding this preview, click Contact us and follow the on-screen instructions to send a request to Databricks. You may not use this preview until you have accepted the Databricks terms and conditions.

    • If you have already accepted the terms and conditions regarding this preview, click Continue if you are already enrolled, and then click Reload Required or restart Visual Studio Code.

  5. Click Reload Required, or restart Visual Studio Code.

  6. Open the extension: on the sidebar, click the Databricks icon.

  7. Set up authentication between the Databricks extension for Visual Studio Code and your Databricks workspace. See Authentication setup for the Databricks extension for Visual Studio Code.

Switch from the Databricks extension for Visual Studio Code, version 2 to version 1

Note

The Databricks extension for Visual Studio Code, version 2 is in Private Preview. The Databricks extension for Visual Studio Code, version 1 is generally available.

  1. In Visual Studio Code, in the Extensions view (on the main menu, click View > Extensions), in the list of installed extensions, click Databricks.

  2. Click Switch to Release Version.

  3. Click Reload Required, or restart Visual Studio Code.

Note

To switch from Databricks extension for Visual Studio Code, version 1 back to version 2, click Switch to Pre-Release Version, and then click Reload Required or restart Visual Studio Code.

Uninstall the extension

If you must uninstall the Databricks extension for Visual Studio Code, do the following:

  1. In Visual Studio Code, click View > Extensions from the main menu.

  2. In the list of extensions, select the Databricks entry.

  3. Click Uninstall.

  4. Click Reload Required, or restart Visual Studio Code.