Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Learn how to use the Databricks CLI from Azure Cloud Shell to perform operations on Databricks.
Prerequisites
An Azure Databricks workspace and access to a compute resource.
A personal access token in Databricks. See Token management.
Use the Azure Cloud Shell
Log in to the Azure portal.
From the top-right corner, click the Cloud Shell icon.

Make sure you select Bash for the Cloud Shell environment. You can select from the drop-down option, as shown in the following screenshot.

Create a virtual environment in which you can install the Databricks CLI. In the snippet below, you create a virtual environment called
databrickscli. This virtual environment uses Python 3.9.virtualenv -p /usr/bin/python3.9 databrickscliSwitch to the virtual environment you created.
source databrickscli/bin/activateInstall the Databricks CLI using zipped sources from GitHub. See Databricks CLI Source installation for Linux, macOS, and Windows for the steps to accomplish this.
Set up authentication with Databricks using the access token that you created as a prerequisite. Use the following command:
databricks configure --tokenWhen prompted, enter the Databricks host value in the format
https://eastus2.azuredatabricks.net. Here, East US 2 is the Azure region where you created your Azure Databricks workspace.At the next prompt, enter the token that you created earlier.
You can now start using Databricks CLI from Azure Cloud Shell.
Use Databricks CLI
You can now start using the Databricks CLI. For example, run the following command to list all the Databricks clusters that you have in your workspace.
databricks clusters list
You can also use the following command to access the Databricks filesystem (DBFS).
databricks fs ls
Next steps
- To learn more about Azure CLI, see Azure CLI overview.
- For a list of available Azure CLI commands, see Azure CLI reference.
- For a list of available Databricks CLI commands, see Databricks CLI commands.