# Configuring Databricks for Data Export

> Use this guide to configure Databricks as a destination for UiPath Data Export. Databricks supports OpenTelemetry (OTEL) Trace exports for Maestro and Agent traces using an OAuth 2.0 Service Principal.

Use this guide to configure Databricks as a destination for UiPath Data Export. Databricks supports OpenTelemetry (OTEL) Trace exports for Maestro and Agent traces using an OAuth 2.0 Service Principal.

## Prerequisites

- An active Databricks workspace with administrator access.
- A Databricks Service Principal with OAuth 2.0 Client Credentials (Client ID and Client Secret).
- A Databricks table to receive OTEL trace data, with the full path in `[Catalog].[Schema].[Table]` format.
- Organization Administrator access in UiPath Test Cloud.

## Step 1: Create a Databricks Service Principal

1. In Databricks, go to **Settings** > **Identity and access** > **Service principals**.
2. Create a new Service Principal and note the **Application ID** (Client ID).

   ![Databricks Service Principal Client ID](https://dev-assets.cms.uipath.com/assets/images/data-export/DatabricksClientID-eeeef221.png)

3. Select the **Secrets** tab, then select **Generate secret** and copy the generated **Client Secret**.

   ![Databricks Generate Secret](https://dev-assets.cms.uipath.com/assets/images/data-export/SecretDatabricks-94e6e1e0.png)

## Step 2: Grant permissions on the Service Principal

Run the following SQL statements in your Databricks workspace to grant the Service Principal access to the catalog, schema, and OTEL table where traces will be written. Replace `Your_Catalog`, `Your_Schema`, `OTEL_Table`, and `<application-id>` with your actual values.

```sql
GRANT USE_CATALOG ON CATALOG `Your_Catalog` TO `<application-id>`;
GRANT USE_SCHEMA ON SCHEMA `Your_Catalog`.`Your_Schema` TO `<application-id>`;
GRANT MODIFY, SELECT ON TABLE `Your_Catalog`.`Your_Schema`.`OTEL_Table` TO `<application-id>`;
```

## Step 3: Configure Data Export in UiPath

1. In UiPath Test Cloud, go to **Admin** and select **Data Export**.
2. Select **+ Add**.
3. **Step 1 – Select tenant**: Choose the tenant for this export, then select **Next**.
4. **Step 2 – Select data sources**: Select **Maestro & Agents**, then select **Next**.
5. **Step 3 – Configure destination**: Select **Databricks** as the connection type. Under **Connection**, select **Add new connection** and enter the following:

   | Field | Description |
   |---|---|
   | **Authentication Type** | Select **OAuth 2.0 Client credentials**. |
   | **Workspace URL** | Your Databricks workspace URL (for example, `https://dbc-xxxxx.azuredatabricks.net`). |
   | **Client ID** | The Application ID from Step 1. |
   | **Client Secret** | The client secret generated in Step 1. |

   Select **Connect** to create the connection, then select **Test Connection** to validate connectivity without sending trace data.

6. **Step 4 – Review and save**: Review the configuration, then select **Save**.

**Result:** The new configuration appears in the **Data Export** table. The **Status** column reflects whether data is being delivered successfully.
