# Connecting Databricks

{% stepper %}
{% step %}

## Click +Add under integrations

Click the add button and select Databricks

<figure><img src="https://1184501161-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyLLMBTNtAM53TC60IKAS%2Fuploads%2Ff1zJa8rPTuxBBhwT0cjJ%2F%2BAdd.png?alt=media&#x26;token=d21691c0-64ac-4693-a81a-91a8883f9a13" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1184501161-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyLLMBTNtAM53TC60IKAS%2Fuploads%2FBhasYJWSxAa1VBoE8mAQ%2FScreenshot%202025-08-14%20at%206.11.53%E2%80%AFPM.png?alt=media&#x26;token=0c38372f-454a-40a2-849f-3394eb260f25" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

## Input a Connection Name and your Databricks Workspace URL and HTTP Path

Input a name for your connection. Then In another tab, go to your account in Databricks and to obtain your Workspace URL and HTTP Path.

To find these, in Databricks navigate to **SQL Warehouses**, select the warehouse you want to connect to DataLab, and click on the **Connection Details** tab.

<figure><img src="https://1184501161-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyLLMBTNtAM53TC60IKAS%2Fuploads%2F3OCK48ORFIT0JUkIEJIA%2Fwarehouse_details.png?alt=media&#x26;token=d8a3f27b-1aea-4f83-b74e-abbeb91b0da8" alt=""><figcaption></figcaption></figure>

Copy Server hostname to your clipboard and paste into the Workspace URL field in DataLab. Then copy your HTTP Path for the warehouse and past into the HTTP Path field in DataLab.

<figure><img src="https://1184501161-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyLLMBTNtAM53TC60IKAS%2Fuploads%2Fvc1Dvy42lVLPRtG3db6V%2FWorkspace_url.png?alt=media&#x26;token=d0a28d9e-b1ea-474e-8e17-51a5fddf5d81" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

## Create a Service Principal User

In another tab, go to your account in Databricks and create a Service Principal User. To do this, click on your user name in the upper right and select Settings.

<figure><img src="https://1184501161-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyLLMBTNtAM53TC60IKAS%2Fuploads%2FS0MCRGrbakA1VFBNsD4c%2FSettings.png?alt=media&#x26;token=519270d1-f4b0-4c12-a8ba-c8ce445fe4b6" alt=""><figcaption></figcaption></figure>

Select **Identity and Access** and then click Manage under **Service principals.** Select **Add service principal** and click **Add new** in the modal. Assign your service principal a name and click **Add**.

You now have a new service principal user. Click into the new service principal to access connection details and to create a secret.

<figure><img src="https://1184501161-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyLLMBTNtAM53TC60IKAS%2Fuploads%2F0cRHMxGVwMqpYxlmjyJq%2FService%20principal.png?alt=media&#x26;token=ed5333df-de67-400a-acba-d4b229c43eba" alt=""><figcaption></figcaption></figure>

Click on the **Secrets** tab and then **Generate secret**. Assign a lifetime value for the secret and click **Generate**.

Copy the secret to your clipboard, navigate back over to DataLab and paste the value into the Client Secret field in the Databricks integration modal. Now do the same for the Client ID.

<figure><img src="https://1184501161-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyLLMBTNtAM53TC60IKAS%2Fuploads%2FN1mBkebruFe9QWQgFP6I%2FGenerate%20Secret.png?alt=media&#x26;token=ea9ccfbc-6234-4ed4-93ec-f34ac3d2ca47" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

## Grant Permissions to your Service Principal User

For this next step you can connect to Databricks using your preferred SQL client or use the SQL Editor within databricks.

Run the following SQL commands to grant your service principal user the necessary permissions. Replace `<catalog_name>` , `<schema_name>` , and `<applicaton_id>` with your actual values:

```sql
GRANT USE CATALOG ON CATALOG <catalog_name> TO `<applicaton_id>`;
GRANT USE SCHEMA ON SCHEMA <catalog_name>.<schema_name> TO `<applicaton_id>`;
GRANT SELECT ON SCHEMA <catalog_name>.<schema_name> TO `<applicaton_id>`;
GRANT CREATE TABLE ON SCHEMA <catalog_name>.<schema_name> TO `<applicaton_id>`;
```

{% endstep %}

{% step %}

## Test and Save your connection

That’s it. Now you can create Data Products within Alkemi using your connect Databricks warehouse!
{% endstep %}
{% endstepper %}
