---
title: "Databricks CLI: Setup, Authentication and Rate Limits"
description: "Databricks CLI configuration encounters rate limits and errors that halt jobs, based on debugging a real 02:14 failure."
url: https://www.activepieces.com/blog/databricks-cli-setup-authentication-and-rate-limits
updated: 2026-12-06
---

> Every page on www.activepieces.com is available as markdown: add `.md` to the URL, or send `Accept: text/markdown`. Site index: https://www.activepieces.com/llms.txt

# Databricks CLI: Setup, Authentication and Rate Limits

By Alex Kim · December 6, 2026 · 14 min read · Filed under [Automation tutorials](https://www.activepieces.com/blog/category/automation-tutorials)

**Summary**

Databricks CLI unattended jobs fail without machine-to-machine OAuth credentials, cascading to nine missed runs with rate limit retries stalling recovery.

- Nine hourly runs missed if job fails at midnight, caught at 9 a.m. standup.
- Jobs/create endpoint rate limit is 20 requests per second, tightest of the three.
- CLI retries total 31.5 seconds across six attempts, waits from 0.5 to 16 seconds.

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](https://www.activepieces.com), 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.

![A laptop and a CI runner server box side by side on a table, a wall clock above the runner showing 2 o'clock; the laptop…](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/25a34885-adfc-4f26-8be2-44cd121465cb/databricks-cli-setup-authentication-and-rate-lim-75788285.webp)

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](https://www.activepieces.com), 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:

```bash
brew tap databricks/tap
brew install databricks
```

On macOS or Linux without Homebrew, use the install script:

```bash
curl -fsSL https://raw.githubusercontent.com/databricks/setup-cli/main/install.sh | sh
```

On Windows, use WinGet:

```powershell
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:

```bash
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.

## 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](https://docs.databricks.com/api/tokens/v1/token), 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:

1. `databricks --version` confirms the build, matching what your job logged.
2. `databricks auth profiles` shows which profiles exist and whether each one is valid.
3. `databricks current-user me` proves the credential works and names the identity behind it.
4. `databricks jobs list` confirms the job is visible to that identity.
5. `databricks jobs list-runs` finds the failed run and its ID.
6. `databricks jobs get-run <RUN_ID>` shows the state and which task stopped.
7. `databricks jobs get-run-output <RUN_ID>` returns the error from that task.
8. `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](https://apis.io/rate-limits/azure-databricks/azure-databricks-rate-limits/) summary of the Azure [Databricks](https://www.databricks.com/blog/announcing-new-identity-and-access-management-enhancements-make-databricks-readily-accessible) 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.

![A deployment script loop: ten job cards, six placed on a workspace shelf, the rest in a stack held behind a stop gate with…](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/2f4a9619-1036-4f61-8a40-35fefa9a2a01/databricks-cli-setup-authentication-and-rate-lim-2ae69b34.webp)

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.

## 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.

![A CI runner server with a terminal window open showing an empty config file, beside a laptop whose open ~/.databrickscfg…](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/76417970-b5fe-471d-814d-60d3b9803f1c/databricks-cli-setup-authentication-and-rate-lim-55ba5abf.webp)

"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.

![Databricks API request limits by endpoint](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/788f7c31-4d63-4feb-8923-fb762145c200/databricks-cli-setup-authentication-and-rate-lim-c4814bf3.svg "Source: APIs.io")

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](https://github.com/databricks/databricks-cli/pull/343), 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.

![How long the Databricks CLI waits between retries](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/721b6f5d-d154-4bc8-9b80-7bc01e48266d/databricks-cli-setup-authentication-and-rate-lim-83a0d278.svg "Source: Databricks CLI GitHub")

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 admin settings showing a table of installed pieces with their display names, package names, and versions](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/7e5a15a9-a2b3-4a86-813a-8647d54dffe8/the-hidden-cost-of-dust-in-enterprise-ai-for-202-efe13131.webp)

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.

![A failed two-step workflow in Activepieces showing a Google Calendar trigger connected to a Gmail send email action, with…](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/d92eb24d-50c6-4cf1-8445-b563b17f0966/lever-api-rate-limits-and-webhooks-2026-guide-sc-e97557a6.webp)

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.

1. Create a service principal for the job.
2. Set up OAuth M2M for that principal.
3. Pin the CLI version in CI.
4. Store the secrets in the CI store.
5. Cap retries at 6 with 0.5 to 16 second backoff.
6. 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.

## Related reading

- [Dropbox API Setup Guide: Access, Limits and Errors](https://www.activepieces.com/blog/dropbox-api-setup-guide-access-limits-and-errors)
- [Notion Webhook Guide: Setup, Payloads, Limits, Errors](https://www.activepieces.com/blog/notion-webhook-guide-setup-payloads-limits-errors)
- [Azure Databricks Automation: A 2026 Setup Guide](https://www.activepieces.com/blog/azure-databricks-automation-a-2026-setup-guide)

## References

- [APIs.io](https://apis.io/rate-limits/azure-databricks/azure-databricks-rate-limits/)
- [Databricks CLI GitHub](https://github.com/databricks/databricks-cli/pull/343)
