--- title: "How to Connect a Databricks Database to Preset" slug: "databricks" description: "Article about how to connect your Databricks database to Preset Cloud." updated: 2023-02-24T19:48:42Z published: 2023-02-24T19:48:42Z canonical: "docs.preset.io/databricks" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.preset.io/llms.txt > Use this file to discover all available pages before exploring further. # Databricks ## Overview This article explains how to connect a Databricks database to Preset. --- ## Allowlist Preset IPs Preset Cloud runs on four regions. For Preset to access your data, first thing you need to do is to add region based Preset IP addresses to your Inbound and Outbound firewall rules. | us-west-2 (us1a) | us-east-1 (us2a) | eu-north-1 (eu5a) | ap-northeast-1 (ap1a) | | --- | --- | --- | --- | | 35.161.45.11 | 44.193.153.196 | 13.48.95.3 | 35.74.159.67 | | 54.244.23.85 | 52.70.123.52 | 13.51.212.165 | 35.75.171.157 | | 52.32.136.34 | 54.83.88.93 | 16.170.49.24 | 52.193.196.211 | If you are not sure where your Preset workspace is located, you can refer to the URL on your browser when accessing Preset. It should look like this: https://xxxxxxxx.us2a.app.preset.io/superset..., where us2a means it is in us-east-1. --- ## Retrieve Databricks Information ### Step 1: Get Databricks Token In Databricks, navigate to **User Settings** → **Access Tokens** → **Generate New Token**. ![Databricks_Get_Token](https://cdn.document360.io/4749ddf8-aa05-4f3f-80e1-07a5d2d0f137/Images/Documentation/Databricks_Get_Token.png) ### Step 2: Get Host and URL Navigate to **Clusters** and select your cluster. ![Databricks_Get_Host_and_URL1](https://cdn.document360.io/4749ddf8-aa05-4f3f-80e1-07a5d2d0f137/Images/Documentation/Databricks_Get_Host_and_URL1.png) ...then copy and save: - **Server Hostname** - **Port** - **HTTP Path** ![Databricks_Cluster_Info.png](https://cdn.document360.io/4749ddf8-aa05-4f3f-80e1-07a5d2d0f137/Images/Documentation/image%28154%29.png) --- ## Connect with the Databricks Connector Let's start by selecting **+ Database** — have a look at [Connecting your Data](/v1/docs/connecting-your-data) if you need help wth this step. Select **Databricks**. ![Database_form.png](https://cdn.document360.io/4749ddf8-aa05-4f3f-80e1-07a5d2d0f137/Images/Documentation/image%28147%29.png) Fill the form with information from the Databricks cluster: - **Host** with the **Server Hostname** - **Port** with the **Port** - **Database name** with the name of the database to be connected - **Access Token** with the generated token - **HTTP Path** with the **HTTP Path** - **Display Name** with the name to be used on Preset for this connection ![Databricks_dynamic_form.png](https://cdn.document360.io/4749ddf8-aa05-4f3f-80e1-07a5d2d0f137/Images/Documentation/image%28156%29.png) Click on **Connect** to create the connection. ## Configure default Catalog and Schema The connection would use the default Catalog and Schema specified on your Databricks settings. However, you can set a different Catalog or Schema to be used as default on Preset on the Advanced Settings: 1. Navigate to **Settings** > **Database Connections** to access the list of existing connections on your Workspace. 2. Hover the mouse over your Databricks connection and click on the pencil icon under the **Actions** column to modify it. 3. Navigate to the **ADVANCED** tab, and expand the **Other** section. 4. You should find a JSON on the **ENGINE PARAMETERS** configuration similar to this one: ``` { "connect_args": { "http_path": "{{Your HTTP Path}}" } } ``` 1. Specify the default Catalog and Schema that should be used on the `connection_args`: ``` { "connect_args": { "http_path": "{{Your HTTP Path}}", "catalog": "{{Catalog Name}}", "schema": "{{Schema Name}}" } } ``` 1. Save changes. You can also query data from different catalogs on the SQL lab, using below structure: ``` SELECT * FROM {{Catalog_Name}}.{{Schema_Name}}.{{Table_Name}} ```