The Databricks CLI is Databricks' command-line tool for its workspace REST API.
It lets you manage jobs, clusters, files and secrets from a terminal or script instead of the web interface, which also means you can chain it into broader automation, whether that's a shell script or a workflow tool like Activepieces, and installing it costs nothing.
Databricks CLI setup is the practice of installing the tool, pinning its version, authenticating it with a token or other credential, and configuring how it handles API rate limits and retries, so that commands and scheduled jobs run reliably without someone watching.
Consider an illustrative scenario, not a real customer. A data team installs the CLI on a laptop, signs in through the browser, and gets a deploy command working. They schedule the same command on a CI runner for 02:00.

At 02:14 the call returns an authentication error, because the runner has no browser session and no stored login. Nobody is paged, because the alert inbox is empty.
The Databricks CLI and the 02:14 job failure
On the timeline below, the laptop and the runner are separate machines with separate credentials, and the job fails on the one that nobody tested. What to take from it: a CLI that works interactively proves nothing about the unattended run.
Whether this happens is decided by setup choices made on day one, and the rest of this article treats them as production settings.
Call the CLI from a shell, a CI runner, or Activepieces, and each action you would click through becomes something a script can repeat. Each of those callers needs its own working credentials, which is why the scenario above failed.
Install on macOS, Linux and Windows
Checked on 2026-12-06, these commands come from Databricks' documentation.
On macOS or Linux with Homebrew:
brew tap databricks/tap
brew install databricks
On macOS or Linux without Homebrew, use the install script:
curl -fsSL https://raw.githubusercontent.com/databricks/setup-cli/main/install.sh | sh
On Windows, use WinGet:
winget install Databricks.DatabricksCLI
Run the same method on the runner that will execute the job. A laptop installed through Homebrew and a runner installed through the script can end up on different releases, and nothing warns you.
Check your installed Databricks CLI version
Run this on every machine that will call the CLI:
databricks -v
It prints the installed release. If the laptop and the runner disagree, you're testing one tool and deploying another.
Don't treat a databricks command that responds as proof you have the current CLI, because the older Python package installed with pip is a separate, legacy tool with different behavior.
Record the version in the job's logs so a failure at 02:14 tells you which build produced it.
Everything below works on Activepieces' free plan. Start without code or a credit card.
Databricks CLI sign-in and version
Once you know which build failed, the sign-in tells you whether it was allowed to run at all. For an unattended job the right sign-in is OAuth machine-to-machine under a service principal, not a person's token.
Token, OAuth or service principal
Only the last row survives a job running with nobody present, because the first two are tied to a person. The table shows the three methods the CLI supports, who each one represents, and how long the credential lives.
| Method | Who signs in | Token lifetime | Where set | Fit for unattended jobs |
|---|---|---|---|---|
| OAuth user-to-machine | A person, in a browser | 1 hour | databricks auth login |
No: it needs someone to approve the login |
| OAuth machine-to-machine | A service principal | 1 hour | Client ID and secret in profile or environment | Yes |
On day one a 2-year token is convenient; on day 700 it is invisible, so the job fails on a night nobody scheduled for.
According to Docs, the 1-hour OAuth tokens are refreshed by the CLI, which is why they carry no such risk. Next comes where those credentials live.
Config file and environment variables
In ~/.databrickscfg, each workspace gets one named section, selected with --profile. Environment variables such as DATABRICKS_HOST and DATABRICKS_TOKEN suit a scheduler better, because the secret sits in the runner's secret store rather than in a file.
For machine-to-machine sign-in, the variables are DATABRICKS_HOST, DATABRICKS_CLIENT_ID and DATABRICKS_CLIENT_SECRET. Use one method per job, so the log of a failed run leaves no doubt about which credential acted.
When a scheduled run fails, this is the order that narrows it down fastest:
databricks --versionconfirms the build, matching what your job logged.databricks auth profilesshows which profiles exist and whether each one is valid.databricks current-user meproves the credential works and names the identity behind it.databricks jobs listconfirms the job is visible to that identity.databricks jobs list-runsfinds the failed run and its ID.databricks jobs get-run <RUN_ID>shows the state and which task stopped.databricks jobs get-run-output <RUN_ID>returns the error from that task.databricks jobs run-now <JOB_ID>reruns it once the cause is fixed.
If steps 2 and 3 fail, stop: the problem is sign-in, and nothing after them can tell you more.
Databricks job failure costs
Installing cost nothing; the failure cost every run between the first rejected sign-in and the moment someone noticed.
Databricks job failure timeline and missed runs
Once a job fails at its first unattended run, it doesn't fail once. It fails on every trigger until a person reads an alert.
An hourly schedule that breaks at midnight and is caught at a 9 a.m. standup has missed nine runs, so downstream dashboards are nine hours stale.
Once a job fails at its first unattended run, it doesn't fail once. It fails on every trigger until a person reads an alert.
After that comes the engineer's cost: tracing an expired token or a version mismatch, rerunning the backlog, and explaining the gap. None of it appears on an invoice.
What Databricks charges, per unit
You are not billed for the CLI. Databricks bills compute in DBUs (Databricks Units), and the rate depends on the compute type and the plan tier. These are AWS list prices per DBU as of 2026-12-06:
| Compute type | Premium | Enterprise |
|---|---|---|
| Jobs Compute | $0.15 | $0.20 |
| All-Purpose Compute | $0.55 | $0.65 |
| Jobs Serverless Compute | $0.35 | $0.45 |
On Premium, Jobs Compute costs under a third of All-Purpose per DBU ($0.15 against $0.55). A scheduled job that runs on an interactive cluster because it was tested there pays that premium on every run.
Serverless sits in between at $0.35 on Premium, which is the price of not managing clusters at all.
Where the docs state rate limits
For anything that creates jobs in bulk, the published limits are low, which is why retry settings matter. The APIs.io summary of the Azure Databricks limits gives jobs/create 20 requests per second, the tightest of the three, which means job creation is your throughput bottleneck.
The REST API default is 30 requests per second, and jobs/runs/submit allows 35 requests per second, which means choosing the right endpoint affects whether you hit rate limits.
A deployment script that registers many jobs in a loop will hit the 20 per second ceiling before the 30 per second default applies. Without backoff, the script gets throttled partway through and leaves the workspace half-configured.

Check the limits for your own cloud and plan before you size a retry policy around them, because these numbers come from the Azure page.
Easier to see it running than to read about it: set it up free, no card.
Databricks errors and rate limits
Start with an expired personal access token, the usual cause. Next comes a CLI version that differs between your laptop and the runner, then a burst of calls that trips a rate limit and returns HTTP 429.
Authentication errors: 401 and 403
When you see a 401, Databricks didn't accept the credential. On a job that ran fine for weeks, the likeliest cause is a personal access token that reached its expiry date.
Generate a new token, then update the secret the runner reads, not just your local profile.
A 403 means the credential was valid but lacks permission for that call. Check the identity that owns the token against the job, cluster or workspace path it touched.
Pin the version in the pipeline, because version drift hides here too: a laptop on a newer CLI can succeed where a runner on an older build rejects the same command.
Config and profile errors
"Profile not found" means the name passed to --profile has no matching section in ~/.databrickscfg. Runners rarely have that file, so the section is missing there even though it exists on your machine.

"Host not set" means the CLI found no workspace URL. Set DATABRICKS_HOST alongside DATABRICKS_TOKEN in the runner's environment, which removes the dependency on a config file altogether.
Databricks 429 rate limit responses and retries
Exceed a rate limit and you get a 429, and the ceilings are low enough that a scheduled fan-out can reach them.
The chart shows three: jobs/create at 20 requests per second, the REST API default at 30 per IP, and jobs/runs/submit at 35, each with the team's burst rate marked against it, which helps teams select an endpoint based on their throughput requirements.
Where the burst bar sits above a limit, a 429 is a matter of when, not whether.
Those limits matter because the CLI's retries are short. According to the Databricks CLI GitHub, the wait doubles from 0.5 seconds on the first retry to 1, 2, 4, 8 and finally 16 seconds on the sixth, so retries compound into increasingly long waits.
That totals 31.5 seconds of waiting, making it impractical to rely on this retry strategy.
If a limit holds for longer than about half a minute, it outlasts every retry, and the job fails anyway.
Reduce the burst rather than lengthen the wait. Stagger submissions, spread calls across the schedule, and give the job its own retry layer with a longer ceiling than 16 seconds.
Where several jobs share one IP address, remember that the 30-per-second default is pooled across all of them.
Running the Databricks CLI in CI with Activepieces
A job that shares a pooled rate limit survives its first unattended night when it signs in as a service principal, pins its CLI version and keeps secrets in the CI store. It also caps its retries and alerts on failure.

Activepieces has a no-code route to the same jobs.
With nobody watching, each rule removes one way a run fails.
- A service principal with OAuth machine-to-machine sign-in means the job no longer depends on one person's login, so a departure or password change can't stop it.
- A pinned CLI version means a new release can't change flag behaviour between Friday's run and Saturday's.
- Secrets held in the CI store keep the client secret out of the repository and out of logs.
- A retry cap with exponential backoff, capped at 6 attempts with waits from 0.5 to 16 seconds, means a failing run gives up after roughly half a minute of waiting. It doesn't hammer a limit that other jobs are drawing on too.
Without a failure alert, the first sign of a dead job is a stale dashboard, which is why it is the fifth change.
Scheduled jobs in GitHub Actions or cron
Run a job from GitHub Actions (the CI service that runs a workflow from a repository) or from cron and it needs the same three things.
They are the version pin in the install step, credentials injected as environment variables from the secret store, and a nonzero exit code that something is watching.
Cron has no secret store of its own, so the credentials usually end up in a file on the host, which is the weakest point of that setup.
Automate scheduling retries and failure notifications
Activepieces can take over the scheduling, the retry settings and the failure notification from a script you would otherwise maintain, and it does so across 751 integrations, roughly 60% of them contributed by the community, meaning you likely already have a community-maintained solution for your integration needs.
Its core is MIT-licensed, and flows are unlimited on every plan, including free.
I haven't confirmed a dedicated Databricks integration, so check the integrations catalog before planning around one; its HTTP step is the fallback for calling the Databricks REST API directly. Credentials live in its connections store, not in a file.

For a coding agent that runs the CLI, Activepieces serves its integrations as MCP tools, on its cloud or self-hosted, at https://www.activepieces.com/mcp.
The agent then sends the failure alert or opens the ticket through a tool your team has already configured, rather than through credentials you paste into a prompt.
Do these in order, because each step assumes the one before it exists.
- Create a service principal for the job.
- Set up OAuth M2M for that principal.
- Pin the CLI version in CI.
- Store the secrets in the CI store.
- Cap retries at 6 with 0.5 to 16 second backoff.
- Add a failure alert.
Once the alert has fired once on a deliberately broken run, you know the whole chain works, and the schedule can go live.
Frequently asked questions
Is the Databricks CLI free to use?
Yes, the CLI itself costs nothing to install or run, as checked on 2026-12-06. Anything it triggers is billed to your workspace as usual.
A scheduled job that starts a cluster or a serverless run is a compute charge. Treat the retry settings as a cost control too: a loop that resubmits failed runs pays for every attempt.
What is the difference between the old CLI and the current one?
Where the old CLI was a Python package installed with pip, the current one is a standalone binary that you install and update separately. The current version covers more of the platform, including bundles, which describe jobs as files you can deploy from CI.
Check which one a runner has with databricks --version before you copy a command from older documentation. A pipeline that still resolves the legacy package will fail on flags the current tool defines, and the failure appears only when the scheduled job runs.
How do I switch between several Databricks workspaces?
Give each workspace its own named profile in ~/.databrickscfg. Then select it per command with the --profile flag or per shell with the DATABRICKS_CONFIG_PROFILE environment variable. databricks auth login --host with the workspace URL creates a profile through the browser flow.
In a scheduled job, pass the profile explicitly rather than relying on the default section. Otherwise a job written against a development workspace can quietly run against production when someone edits the file on that machine.
Can I use the Databricks CLI without a personal access token?
Yes. For a person at a keyboard, OAuth through databricks auth login signs in via the browser and avoids a long-lived secret on disk.
For an unattended job, the better choice is a service principal using OAuth machine-to-machine, with a client ID and secret supplied through environment variables from your CI secret store.
With a service principal, the job's access is tied to an identity that outlives any one employee, and you can revoke it without touching anyone's personal account.
Which methods are enabled still depends on your workspace and cloud settings, so confirm with your administrator before you design the job around one.


