π Steps to Setup Databricks CLI on Linuxπ
1. Install Python & pipπ
Databricks CLI is a Python package. Check if you have Python 3 installed:
If not, install it:
2. Install Databricks CLIπ
Run:
Check installation:
3. Generate a Personal Access Token (PAT) in Databricksπ
- Go to your Databricks workspace in the browser.
- Click on your username (top right) β User Settings.
- Under Access Tokens, click Generate New Token.
- Copy the token (you wonβt see it again).
4. Configure Databricks CLIπ
Run:
It will ask:
-
Databricks Host (URL) β Example:
-
AWS:
https://<workspace-url>.cloud.databricks.com
- Azure:
https://<workspace-name>.azuredatabricks.net
- Token β Paste the token you generated.
5. Test the CLIπ
Run a test command to list clusters:
If successful, youβll see details of your clusters.
6. (Optional) Store Multiple Profilesπ
You can save multiple workspace logins using profiles in ~/.databricks/config
.
Example:
[DEFAULT]
host = https://myworkspace.azuredatabricks.net
token = dapi123abc
[staging]
host = https://staging-workspace.azuredatabricks.net
token = dapi456def
Then use:
7. Use CLI for Common Tasksπ
Examples: