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

# Databricks

> Connect Databricks to Langdock using your own OAuth client.

Connect **Databricks** with an OAuth app registered by your organization. Langdock does not provide a managed client for this integration. To connect with a personal access token instead, use [Databricks PAT](https://docs.langdock.com/en/admin/manage-integrations/integration-setup-guides/databricks.md).

## Prerequisites

* A Databricks account admin to register the app and a Langdock Workspace admin to configure it.
* A Databricks Workspace that members can sign in to and Langdock can reach. If you use an IP allowlist, see [Static IP configuration](https://docs.langdock.com/en/admin/security/static-ip-configuration.md).
* Access to the resources you plan to use. Direct SQL requires Unity Catalog and an accessible SQL warehouse. Genie requires access to a Genie agent and its data sources.

## Set up the integration

**1. Copy the redirect URL**

In **Workspace settings** → **Integrations**, open **Databricks**. Under **OAuth clients**, click **Configure your OAuth client to use this integration** and copy **Redirect URL**.

**2. Register the app in Databricks**

As a Databricks account admin, open the account console for your cloud: `accounts.cloud.databricks.com` for AWS, `accounts.azuredatabricks.net` for Azure, or `accounts.gcp.databricks.com` for Google Cloud. Go to **Settings** → **App connections** → **Add connection**.

Enter a name, paste the exact **Redirect URL** from Langdock, select **All APIs** under **Access scopes**, and select **Generate a client secret**. The account console also allows `offline_access` automatically. Set token lifetimes according to your security policy. When a refresh token expires, users must sign in again.

Copy the **Client ID** and client secret from **Connection created** and store the secret securely. Databricks does not show it again. App changes can take up to 30 minutes to take effect. See [Databricks app registration](https://docs.databricks.com/aws/en/integrations/enable-disable-oauth#enable-custom-oauth-applications-using-the-databricks-ui).

**3. Configure the client in Langdock**

Enter the **Client ID** and **Client secret** in Langdock. Keep the scopes `all-apis offline_access`: `all-apis` covers the APIs used by the integration, while `offline_access` allows refresh tokens. The `sql` scope alone is not enough.

Under **OAuth connection details**, enter **Workspace URL** if everyone should use the same Databricks Workspace, or leave it empty so members enter their own. Use the standard HTTPS Workspace URL, without a custom domain or port, not the account console URL.

Choose who can use the client under **Access**, then click **Save** and confirm. If it is not active, select it from the list and confirm the switch. See [Bring Your Own OAuth Client](https://docs.langdock.com/en/admin/manage-integrations/bring-your-own-oauth.md) for group access and client selection.

**4. Connect an account**

Open **Plugins** → **Databricks** → **Add connection**. Select the configured client and enter your Workspace URL if prompted. Sign in with your Databricks account and approve access. Use **Get connected identity** to check the connected account.

## Permissions and limits

Databricks uses the identity that authorized the selected connection. Unity Catalog applies that identity's grants, row filters, and column masks to governed data. A [preselected connection](https://docs.langdock.com/en/using-langdock/integrations/connections.md) uses its owner's identity, not the person chatting. For individual access in shared Agents, have each member connect their own account.

For direct SQL, grant `USE CATALOG`, `USE SCHEMA`, and `SELECT` on the intended sources, plus **CAN USE** on the SQL warehouse. For Genie, grant **CAN RUN** on the Genie agent and access to its Unity Catalog data. Check the execution identity for jobs and saved queries because it can differ from the connected account.

**Run SQL query** accepts a single read query and requires confirmation; compute charges can apply. Other actions can make changes. Grant only the privileges needed and [restrict actions in Langdock](https://docs.langdock.com/en/admin/manage-integrations/manage-action-level-scopes.md) as appropriate. Results can remain in the conversation and model context; review the [data processing terms](https://docs.langdock.com/en/admin/compliance-and-governance/legal-compliance.md).

## Troubleshooting

| Issue | What to check |
| - | - |
| Redirect URL rejected | Copy the exact URL from Langdock and check the host, path, and trailing slash. Allow up to 30 minutes for app changes. |
| `invalid_client` or sign in fails | Check that the client ID and secret belong to the same active app and that the connection uses a standard HTTPS Workspace URL. |
| `403` or a missing resource | Check **Get connected identity**, the Workspace and resource grants, **CAN USE** for SQL, or **CAN RUN** for Genie. If the identity check fails, also check the Workspace URL and scopes. |
| Token expired or access revoked | [Reauthorize](https://docs.langdock.com/en/using-langdock/integrations/connections.md#reauthorize-oauth-connections) the connection. If the app or scopes changed, check the active client and reconnect. |
| Query pending or action outcome unknown | Check **Get SQL result** with the existing statement ID, or check the asset or Databricks Query History before repeating an action. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.