Databricks auth: Personal access token (PAT)¶
When to use it¶
- Getting started, a demo, or a short-lived evaluation.
- Works on any cloud (AWS, Azure, GCP).
Avoid it for production:
- The token acts as your user, with your permissions.
- It stops working when that user leaves or loses access.
- Tokens expire on the lifetime you set.
For production, use Service principal (OAuth M2M).
What you need¶
- A Databricks user account with access to the workspace.
- Your workspace URL — see Workspace URL.
Step 1 — Create the token¶
In the Databricks workspace:
- Open the user menu (avatar, top right) → Settings.
- Go to Developer → Access tokens → Manage.
- Wording can vary by deployment; see the PAT documentation for your cloud.
- Choose Generate new token.
- Optionally set a comment and a lifetime (days until expiry).
- Under Scope, choose Other APIs (not BI Tools).
-
In API scope(s), add all of these:
API scope access-managementappsclusterscustom-llmsgeniejobsknowledge-assistantsmlflowmodel-servingscimsqlsupervisor-agentsunity-catalogvector-searchmlflowandscimare required when trace collection is enabled (TRACE_COLLECTION_ENABLED=true) — for MLflow traces and for resolving user identities in trace metadata.Note
If required scopes are not visible in the API scopes list, create the token using all APIs.
-
Click Generate, then copy the token once while it is shown. It usually starts with
dapi.
Step 2 — Fill in the collector form¶
In the collector's Datasource Configuration:
| Field | What to enter |
|---|---|
| Databricks host | Your workspace URL |
| Authentication method | Personal access token |
| Databricks token | The token you copied |
Selecting Personal access token hides the other methods' credential fields, so there is nothing else to fill in.
Step 3 — Grant permissions¶
The token inherits your user's permissions, so your user needs:
- The asset permissions in Assets permissions.
- The
systemcatalog grants below, if model usage collection is enabled.
Workspace entitlements are not Unity Catalog privileges. Even with Admin access, the identity needs these grants or the model usage and serving endpoint usage collectors return no rows.
- Run them as a metastore admin or account admin.
- Replace the principal with the identity the collector authenticates as.
You also need a SQL warehouse for these queries:
- Grant Can Use on it: SQL Warehouses → your warehouse → Permissions.
- Copy its HTTP path from Connection details and enter it in the collector's SQL warehouse HTTP path field.
For a PAT, the principal in those grants is the token owner's user name.