Databricks Platform Architect · Section 2 · 13% of the exam
Use the Account API and workspace APIs with the right authentication (OAuth M2M/U2M, personal access tokens, cloud-native tokens).
One of the objectives of the Databricks Platform Architect accreditation (AWS, Azure or GCP) exam, in the section “Account API and Automation”. Here is what it covers, the points to remember and a question to try.
What it covers
Databricks has two REST surfaces: the Account API on a per-cloud account host and the workspace APIs on each workspace URL. OAuth is the recommended way to authenticate to both: M2M for service principals, U2M for people, or token federation for CI. Personal access tokens are legacy credentials that only work in one workspace, and Azure and Google Cloud add their own token types.
Points to remember
- Account API = per-cloud account host plus
/api/2.0/accounts/<account-id>/...:accounts.cloud.databricks.com(AWS),accounts.azuredatabricks.net(Azure),accounts.gcp.databricks.com(GCP). Workspace APIs use the workspace URL. - OAuth is recommended everywhere: M2M (client credentials with a service principal's OAuth secret) for automation, U2M (
databricks auth login) for people, token federation to avoid stored secrets in CI. - OAuth secrets last up to 730 days, up to five per service principal, and are shown once. Access tokens last one hour and unified-auth tools refresh them.
- Account-level OAuth tokens work for account APIs and any workspace the service principal can access; workspace-level tokens work in one workspace. Account APIs need an account admin.
- PATs are legacy, workspace-only and can't automate account-level work. Govern them with the Advanced settings toggle,
maxTokenLifetimeDays(default 730), CAN USE permissions, and auto-revocation after 90 days unused.
Try a question
A CI runner still has DATABRICKS_HOST and DATABRICKS_TOKEN set as environment variables from an older setup. An engineer adds a DEFAULT profile to ~/.databrickscfg with a service principal's client_id and client_secret. CLI commands still run as a former employee's user. What explains this, and what is the fix?
- AThe
.databrickscfgDEFAULT profile always overrides environment variables, so the service principal must be missing a workspace assignment - BEnvironment variables take precedence over the profile file, so the leftover
DATABRICKS_TOKENis used; remove it so the service principal's OAuth credentials apply - COAuth M2M is tried before PATs, so the CLI fell back to the token because the OAuth secret has expired
- DThe CLI picks the most recently created credential, so the PAT must be newer than the OAuth secret
Show the answer
B. Databricks unified authentication reads configuration from direct settings in code, then environment variables, then the .databrickscfg profile. It stops as soon as it finds a setting, so DATABRICKS_TOKEN in the environment wins over anything in the file. The default credential order is also PAT, then OAuth M2M, then OAuth U2M. Unset the stale variables, revoke the old token, and ideally use workload identity federation so no secret sits on the runner.
Written for practice in the style of the exam: never a question from the real exam.
In the course
The lesson Databricks REST APIs and Authentication teaches this objective (about 35 minutes), and 10 practice questions test it. The course has lessons, exam-style questions, timed practice exams and an AI tutor for every objective, and a pass prediction that tells you when you're ready to book.