This document provides a step-by-step guide to setting up the Databricks CLI on a Linux system. The Databricks CLI enables interaction with Databricks using the command-line interface.
Prerequisites
Before you begin, ensure the following prerequisites are met:
- Python and pip should be installed on your Linux system.
Step-by-step guide
Step 1: Install Databricks-CLI Module
- Open a terminal on your Linux machine.
- Run the following command to install the Databricks-CLI module using pip:
pip install databricks-cli
- In the terminal, run the following command to configure the Databricks CLI:
databricks configure
- Enter the required details when prompted:
- Databricks Host: Enter the Databricks host URL (e.g., {+}https://adb-68686xxxxxxxxxxx.7.azuredatabricks.net+).
- Username: Enter your username (e.g., sample@example.com).
- Password: Enter your Databricks access token. Repeat for confirmation: Re-enter your Databricks access token.
- After providing the required details, the Databricks CLI will be configured.
Step 3: Check Databricks Configuration
- To verify the configuration, run the following command in the terminal:
This command checks if the authentication is working properly. If no error is thrown, it indicates a successful configuration.databricks workspace ls /Users/sample@example.com
- Additionally, retrieve information about a specific cluster using the following command:
databricks clusters get --cluster-id 1209-xxxxx-xxxxxxx
Conclusion
You have now successfully installed and configured the Databricks CLI on Linux. Utilize the CLI to interact with Databricks and perform various operations from the command line.