We can use the Databricks cli to interact with Databricks workspaces programmatically on the command line. In this post, I want to share simple usage about Databricks cli.

Install and setup

On macOS, we can install databricks cli via Homebrew:

brew tap databricks/tap
brew install databricks

Personal access token:

User setting --> Developer --> Access tokens, there, you can generate a new token for connection in the cli.

Connect to databricks:

databricks configure

Paste the databricks workspace URL: https://adb-<workspace-id>.azuredatabricks.net/ and the personal access token.

multiple profiles

To add a second profile, just edit ~/.databrickscfg, and add a new section:

[new_profile_name]
host = xxxxx
token = xxxxx
profile = profile_name

Show a list of configured profiles:

databricks auth profiles

Show info about a profile:

databricks auth env --profile <profile_name>

references