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

# Integrate Databricks SQL Tool

This guide walks you through configuring and authenticating the Databricks SQL Query tool in Airia, enabling your agents to execute SQL queries against your Databricks Lakehouse.

## Prerequisites

To connect Airia to your Databricks SQL Warehouse, you will need the following details:

* **Warehouse Hostname**
* **Warehouse HTTP Path**
* **Warehouse Port** (default: `443`)
* **Personal Access Token (PAT)** for an authenticated user.

> 💡 Note: It is recommended to use a user with least-privileges, specifically with read access and permissions to run SQL statements on your Warehouse.

### Retrieve Databricks Connection Details

Follow these steps to obtain the necessary connection details from your Databricks account:

1. Log in to your Databricks account.
2. In the sidebar, select **SQL Warehouses**.
3. Choose an active **Warehouse** that has access to the database schema you want to work with.
4. Select **Connection Details** to view the **Warehouse Hostname**, **HTTP Path**, and **Port**.

<img src="https://mintcdn.com/airia/ALXu7UtGeI560bwk/integrations/Images/databricks_account.png?fit=max&auto=format&n=ALXu7UtGeI560bwk&q=85&s=210cc36ba9a4b4b419e731798bec7789" alt="Retrieve Databricks connection details" width="1641" height="1230" data-path="integrations/Images/databricks_account.png" />

### Generate a Personal Access Token (PAT)

Airia tools for Databricks support authentication via a Personal Access Token (PAT).

1. Log in to Databricks with the user account you intend to use for Airia (ensure it has appropriate permissions).
2. Navigate to **Settings** (usually by clicking your username in the top right).
3. Select **Developer** > **Access Tokens**.
4. Click **Manage** and then **Generate new token**.
5. Follow the prompts to create your PAT. Copy the token immediately as it will not be shown again.

For more detailed instructions on generating PATs, refer to the [Databricks documentation on Personal Access Tokens](https://docs.databricks.com/aws/en/dev-tools/auth/pat.html).

## Add and Configure the Databricks SQL Query Tool

1. **Add the Databricks SQL Query Tool:**
   * Navigate to the **Tools** section in your Airia dashboard.
   * From the library, select **Databricks SQL Query** to add it to your project.

2. **Provide Connection Details:**
   * On the tool configuration page, provide the values retrieved from your Databricks account:
     * **Warehouse Hostname**
     * **Warehouse HTTP Path**
     * **Warehouse Port**
   * For the **Personal Access Token**, you must add it as a new **Credentials** object. Select the appropriate credential type (e.g., `Bearer Token` or `API Key`) and paste your PAT.

3. **Save the Tool:**
   * Click **Save** to add the configured tool to your library.

## Next Steps

Now that the Databricks SQL Query tool is added, you can integrate it into an agent to execute queries against your Databricks database.

* [Use Databricks tools in an Agent](databricks_tools.mdx)
