> ## Documentation Index
> Fetch the complete documentation index at: https://support.configview.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Databricks setup

## Part 1: Databricks Billable Usage Ingestion

Set up a Databricks app so ConfigView can pull your **Azure Databricks billable usage** (DBU consumption) and workspace inventory into the dashboard. This is the per-workspace, per-cluster, per-SKU detail behind the single **Azure Databricks** line item on your Azure invoice.

<Info>
  ConfigView reads from the **Databricks account console** (`accounts.azuredatabricks.net`), not from an individual workspace. You need the **account admin** role in Databricks and the ability to create a **Microsoft Entra ID** app registration. The billable usage download API requires account admin.
</Info>

***

### Step 1: Find your Databricks account ID

1. Sign in to the [Azure Databricks account console](https://accounts.azuredatabricks.net) as an account admin.
2. Click your username in the top-right corner — the **Account ID** (a UUID) is shown in the menu.
3. Copy it. This becomes the `DATABRICKS_ACCOUNT_ID` secret.

***

### Step 2: Create a Microsoft Entra service principal

ConfigView authenticates to the Databricks account API using a **Microsoft Entra ID app registration** (service principal). You can reuse the same app registration you created for the Azure integration, or create a dedicated one.

#### 2a. Register the app (or reuse the Azure one)

1. In the [Azure portal](https://portal.azure.com), go to **Microsoft Entra ID → App registrations → ➕ New registration**.
2. Name it `ConfigView Databricks`, leave the defaults, and click **Register**.
3. On the **Overview** page, copy the **Application (client) ID** and the **Directory (tenant) ID** — these become `DATABRICKS_AZURE_CLIENT_ID` and `DATABRICKS_AZURE_TENANT_ID`.

#### 2b. Create a client secret

1. Open **Certificates & secrets → Client secrets → ➕ New client secret**.
2. Add a description and expiry, click **Add**, and **immediately copy the secret's `Value`** — it becomes `DATABRICKS_AZURE_CLIENT_SECRET`.

<Warning>
  Copy the **Value** column, not the **Secret ID**. The value is shown only once; if you navigate away, delete the secret and create a new one.
</Warning>

***

### Step 3: Add the service principal to the Databricks account as an admin

The billable usage download API only responds to an **account admin**. Add the Entra service principal to the Databricks account and grant it the admin role.

1. In the [account console](https://accounts.azuredatabricks.net), go to **User management → Service principals → Add service principal**.
2. Choose **Microsoft Entra ID managed** and paste the **Application (client) ID** from Step 2a.
3. Open the service principal and enable the **Account admin** role.

***

### Step 4: Add the secrets to ConfigView

1. Go to your ConfigView dashboard: `https://{companyname}.configview.com/admin/secret/`
2. Click **Add Secret** and create each of the following:

| Secret name                      | Value                                |
| -------------------------------- | ------------------------------------ |
| `DATABRICKS_ACCOUNT_ID`          | Databricks Account ID from Step 1    |
| `DATABRICKS_AZURE_TENANT_ID`     | Directory (tenant) ID from Step 2a   |
| `DATABRICKS_AZURE_CLIENT_ID`     | Application (client) ID from Step 2a |
| `DATABRICKS_AZURE_CLIENT_SECRET` | Client secret **Value** from Step 2b |

3. Click **Save**.

<Note>
  The token scope and account host are **fixed values** that ConfigView fills in automatically, so there is no scope secret to set. If you run a non-public Azure cloud (e.g. Azure Government), set the optional `DATABRICKS_ACCOUNT_HOST` secret to that cloud's account console URL; otherwise it defaults to `https://accounts.azuredatabricks.net`.
</Note>

***

### Step 5: Enable the Databricks App in ConfigView

1. Go to: `https://{companyname}.configview.com/admin/cron/`
2. You should see **Databricks** in the list of available apps.
3. Select the scripts you want to run (**Workspaces** and **Billable Usage**).
4. Click **Save**.

***

### Step 6: Verify

1. Go to: `https://{companyname}.configview.com/admin/status/`
2. Run the **Databricks** health check.
3. All checks should pass.

If the **Billable usage download** check returns a `403`, the service principal is not yet an account admin (Step 3). A `404` means the download API is not enabled for your account — see the note below.

<Note>
  **Azure note.** Azure Databricks meters DBUs onto your Azure invoice, and the account-level billable usage download API is the supported way to pull the underlying per-resource detail. If your account returns a `404` for the download endpoint, the equivalent data is available from the `system.billing.usage` system table (Unity Catalog) — contact ConfigView and we will switch this app to the system-table ingestion path.
</Note>

***

### Data Tables

Once the scripts run, these Databricks tables are created in your database. All tables include a `run_at` column for historical tracking; the latest snapshot is the rows with the most recent `run_at`.

* `databricks_workspaces` — account workspace inventory: workspace name, deployment name, Azure region (`location`), pricing tier, status, and the Azure subscription / resource group each workspace bills into.
* `databricks_billable_usage` — every documented column of the billable usage log, one row per workspace / usage day / cluster / SKU:
  * `workspace_id`, `usage_date`, `usage_timestamp`
  * `cluster_id`, `cluster_name`, `cluster_node_type`
  * `cluster_owner_user_id`, `cluster_owner_user_name` (cluster creator's email — captured only when the service principal has PII access)
  * `cluster_custom_tags`, `tags` (JSON)
  * `sku` (billing SKU, e.g. `PREMIUM_ALL_PURPOSE_COMPUTE`)
  * `dbus` (Databricks Units consumed), `machine_hours`

<Note>
  The usage download re-emits each full month on every run, so the **Billable Usage** script pulls a rolling window (the current month plus one prior month by default). To backfill a longer history, set the `DATABRICKS_USAGE_LOOKBACK_MONTHS` environment variable on the satellite before a manual run.
</Note>

Join `databricks_billable_usage.workspace_id` to `databricks_workspaces.workspace_id` to attribute DBU spend to named workspaces, Azure regions, and subscriptions.
