Inventory
databricks token-management list --output json | \
jq -r '.[] | [.created_by_username, .comment, (.creation_time/1000|todate), (if .expiry_time == -1 then "never" else (.expiry_time/1000|todate) end)] | @tsv' | sort
Group tokens by owner: people, service principals, and "people's tokens used by automation" (the riskiest kind).
1. People: OAuth U2M
databricks auth login --host https://adb-1234567890123456.7.azuredatabricks.net --profile prod
databricks clusters list --profile prod
Tokens are short-lived and refreshed automatically. IDEs (VS Code extension) and the SDKs use the same profiles. Tools that connect via ODBC/JDBC (Power BI, Tableau, DBeaver) support OAuth/Entra ID sign-in too — switch their connection auth type.
2. CI/CD: service principal without secrets
GitHub Actions / Azure DevOps with Entra workload identity federation:
- Entra service principal with a federated credential for the repo/environment.
- Add the service principal to the workspace (account console) with the permissions it needs.
- Authenticate with the Azure CLI login step, then the Databricks CLI uses
azure-cliauth:
- uses: azure/login@v2
with: { client-id: ${{ vars.AZURE_CLIENT_ID }}, tenant-id: ${{ vars.AZURE_TENANT_ID }}, allow-no-subscriptions: true }
- run: databricks bundle deploy -t prod
env:
DATABRICKS_HOST: ${{ vars.DATABRICKS_HOST }}
DATABRICKS_AUTH_TYPE: azure-cli
Databricks also supports OAuth token federation directly with GitHub's OIDC tokens; check availability for your account.
Where federation isn't possible: a Databricks service principal with an OAuth M2M secret (DATABRICKS_CLIENT_ID / DATABRICKS_CLIENT_SECRET) — short-lived access tokens, one rotatable secret.
3. Azure Data Factory
Use the factory's managed identity in the Azure Databricks linked service:
- Add the ADF managed identity to the workspace as a service principal (by its application ID).
- Grant it permissions on the clusters/policies/jobs it uses (
CAN_MANAGE_RUNon jobs,CAN_ATTACH_TO/CAN_RESTARTon clusters orCAN_USEon a policy). - Switch the linked service authentication to Managed service identity and remove the token.
4. Jobs running as people
Change run_as of production jobs to a service principal so they don't depend on a person's account or token:
resources:
jobs:
nightly_sales:
run_as:
service_principal_name: "8a7c1e2f-0000-1111-2222-333344445555"
5. Restrict PATs
- Workspace settings: set a maximum lifetime for new tokens.
- Token permissions: only a small group (or nobody) can create PATs.
- Delete old tokens after their replacement is proven, starting with "never expires" ones.
Tip
Do one integration end to end per day and delete its PAT the same day. Leaving the old token "just in case" is how migrations stall at 90%.
Checklist
- PAT inventory grouped by owner/integration
- Users on OAuth U2M; BI tools on OAuth/Entra
- CI/CD on federation or M2M OAuth; ADF on managed identity
- Jobs run as service principals
- PAT creation restricted; old tokens deleted