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

# Databricks

> Connect BonData to Databricks to sync your lakehouse data

Databricks is a unified analytics platform built on Apache Spark, combining data engineering, data science, and machine learning in a single lakehouse architecture. With BonData, you can connect to your Databricks workspace to read and enrich your lakehouse data within Agent workflows.

BonData supports two authentication methods for Databricks.

<CardGroup cols={2}>
  <Card title="OAuth Authentication" icon="shield-check" href="#oauth-authentication">
    Recommended for production environments
  </Card>

  <Card title="Personal Access Token" icon="key" href="#personal-access-token">
    Quick setup for testing
  </Card>
</CardGroup>

***

## OAuth Authentication

Follow these steps to configure OAuth authentication for BonData.

### Step 1: Create an OAuth Application

1. Log in to your Databricks workspace
2. Go to **Settings** → **Developer** → **OAuth Applications**
3. Click **Create Application**
4. Configure the application:
   * **Name**: `BonData Integration`
   * **Redirect URL**: `https://app.bondata.ai/auth/oauth2/callback`
   * **Scopes**: Select `all-apis` and `offline_access`
5. Click **Create**

### Step 2: Copy Credentials

After creation, you'll see:

* **Client ID** - the unique identifier for your OAuth app
* **Client Secret** - click **Generate Secret** to create one

<Warning>
  Copy both values - the Client Secret won't be shown again.
</Warning>

### Step 3: Get Your Workspace URL

Your workspace URL is in your browser address bar:

* Example: `https://adb-1234567890123456.7.azuredatabricks.net`

### Step 4: Enter Credentials

Enter your Client ID, Client Secret, and Workspace URL in BonData, then click Connect to authorize via OAuth.

### Required Fields (OAuth)

| Field         | Description                   |
| ------------- | ----------------------------- |
| Client ID     | OAuth app Client ID           |
| Client Secret | OAuth app Client Secret       |
| Workspace URL | Your Databricks workspace URL |

***

## Personal Access Token

Follow these steps to create a Personal Access Token for BonData.

### Step 1: Access User Settings

1. Log in to your Databricks workspace
2. Click your username in the top-right corner
3. Select **Settings** from the dropdown

### Step 2: Generate a Token

1. Go to the **Developer** section
2. Click **Manage** next to Access tokens
3. Click **Generate new token**
4. Enter a description (e.g., `BonData Integration`)
5. Set the lifetime (or leave blank for no expiration)
6. Click **Generate**
7. **Copy the token immediately** - it won't be shown again

### Step 3: Get Your Workspace URL

Your workspace URL is in your browser address bar:

* Example: `https://adb-1234567890123456.7.azuredatabricks.net`

### Step 4: Enter Credentials

Enter your Personal Access Token and Workspace URL in BonData.

### Required Fields (Token)

| Field                 | Description                                                    |
| --------------------- | -------------------------------------------------------------- |
| Personal Access Token | Generated from Databricks Settings → Developer → Access tokens |
| Workspace URL         | Your Databricks workspace URL                                  |
