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".
This v1 skill is being cut in the v2 rebuild — no direct replacement. One-line setup, not a skill — auth now lives in the databricks-workspace-mcp.env.sops + each skill's ## Prerequisites.
See the pack README → Migration: v1 → v2 for the full map and rationale.
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.
Opens browser for OAuth consent. Token auto-refreshes (1-hour lifetime).
# Interactive OAuth login
databricks auth login --host https://adb-1234567890123456.7.azuredatabricks.net
# Verify — prints current user
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.
# Use a specific profile
databricks workspace list / --profile staging
Step 4: Verify SDK Connection
from databricks.sdk import WorkspaceClient
# Auto-detects from env vars or ~/.databrickscfg
w = WorkspaceClient()
me = w.current_user.me()
print(f"Authenticated as: {me.user_name}")
print(f"Workspace: {w.config.host}")
print(f"Auth type: {w.config.auth_type}")
# Quick smoke test — list clusters
clusters = list(w.clusters.list())
print(f"Clusters found: {len(clusters)}")
Step 5: Service Principal Authentication (Python SDK)
from databricks.sdk import WorkspaceClient
from databricks.sdk.config import Config
# Explicit M2M config for CI/CD scripts
config = Config(
host="https://adb-1234567890123456.7.azuredatabricks.net",
client_id="00000000-0000-0000-0000-000000000000",
client_secret="dose00000000000000000000000000000000",
)
w = WorkspaceClient(config=config)
# Or use a named profile
w = WorkspaceClient(profile="production")
Output
Databricks CLI v2 installed and on PATH
Python SDK (databricks-sdk) installed
Authentication credentials stored in env vars or ~/.databrickscfg
Connection verified with databricks current-user me
Error Handling
Error
Cause
Solution
INVALID_TOKEN
Token expired or revoked
Generate a new PAT or re-run databricks auth login