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:

  • Visual Studio Code version 1.69.1 or higher. To view your installed version, click Code > About Visual Studio Code from the main menu on Linux or macOS and Help > About on Windows. To download, install, and configure Visual Studio Code, see Setting up Visual Studio Code.

  • Visual Studio Code must be configured for Python coding, including availability of a Python interpreter. For details, see Getting Started with Python in VS Code.

  • The Databricks extension for Visual Studio Code. See Install and open the extension.

Install and open the extension

  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. Restart Visual Studio Code.

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

Configure the project

With the extension opened, open your code project’s folder in Visual Studio Code (File > Open Folder). If you do not have a code project then use PowerShell, your terminal for Linux or macOS, or Command Prompt for Windows, to create a folder, switch to the new folder, and then open Visual Studio Code from that folder. For example:

mkdir databricks-demo
cd databricks-demo
code .
md databricks-demo
cd databricks-demo
code .

Tip

If you get the error command not found: code, see Launching from the command line in the Visual Studio Code documentation.

Next steps

After you install and open the extension and configure your project in Visual Studio Code, you must 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.

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 for Visual Studio Code entry.

  3. Click Uninstall.

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