| name | databricks-install-auth |
| description | Install and configure Databricks CLI and SDK authentication.
Use when setting up a new Databricks integration, configuring tokens,
or initializing Databricks in your project.
Trigger with phrases like "install databricks", "setup databricks",
"databricks auth", "configure databricks token", "databricks CLI".
|
| allowed-tools | Read, Write, Edit, Bash(pip:*), Bash(databricks:*), Bash(curl:*), Grep |
| version | 1.0.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| compatible-with | claude-code, codex, openclaw |
| tags | ["saas","databricks","authentication"] |
Databricks Install & Auth
Overview
Set up Databricks CLI v2, Python SDK, and authentication. Covers Personal Access Tokens (legacy), OAuth U2M (interactive), and OAuth M2M (service principal for CI/CD). Databricks strongly recommends OAuth over PATs for production.
Prerequisites
- Python 3.8+ with pip
- Databricks workspace URL (e.g.,
https://adb-1234567890123456.7.azuredatabricks.net)
- For PAT: User Settings > Developer > Access Tokens in workspace UI
- For OAuth M2M: Service principal with client ID and secret
Instructions
Step 1: Install Databricks CLI and Python SDK
set -euo pipefail
curl -fsSL https://raw.githubusercontent.com/databricks/setup-cli/main/install.sh | sh
databricks --version
pip install databricks-sdk
pip install databricks-connect==14.3.*
Step 2: Configure Authentication
Option A: Personal Access Token (Quick Start)
Generate a PAT in workspace UI: User Settings > Developer > Access Tokens.
databricks configure --token
export DATABRICKS_HOST="https://adb-1234567890123456.7.azuredatabricks.net"
export DATABRICKS_TOKEN="dapi_your_token_here"
Option B: OAuth U2M (User-to-Machine — Interactive)
Opens browser for OAuth consent. Token auto-refreshes (1-hour lifetime).
databricks auth login --host https://adb-1234567890123456.7.azuredatabricks.net
databricks current-user me
Option C: OAuth M2M (Service Principal — CI/CD)
Uses client credentials flow. No browser required. Create a service principal in Account Console > Service Principals, then generate an OAuth secret.
export DATABRICKS_HOST="https://adb-1234567890123456.7.azuredatabricks.net"
DATABRICKS_CLIENT_ID=
DATABRICKS_CLIENT_SECRET=
databricks current-user me