Databricks Integration
The Databricks Integration allows your app to connect to Databricks for secure data access, querying, and analytics. Once connected, you can run SQL queries, retrieve results, and power data-driven workflows directly from your app.
What You Can Do
With Databricks, your app can:
- Connect securely to your Databricks workspace.
- Run SQL queries or fetch data programmatically.
- Build dashboards and data visualizations on top of your Databricks tables.
- Automate workflows triggered by new or updated data.
- Combine Databricks with AI models for advanced analytics.
Step 1: Get Your Databricks Credentials
1 - Log in to your Databricks Workspace.
2 - Get your DATABRICKS_HOST and DATABRICKS_WAREHOUSE_ID:
- Go to
SQL Warehousesfrom the sidebar. - Select your desired warehouse.
- Click
Connection details. - Copy the Server hostname (this is your DATABRICKS_HOST).
- Copy the HTTP path removing the
/sql/1.0/warehouses/prefix (this is your DATABRICKS_WAREHOUSE_ID).

3 - Get your DATABRICKS_CATALOG and DATABRICKS_SCHEMA:
- Click the SQL Editor from the sidebar.
- Choose the DATABRICKS_CATALOG and DATABRICKS_SCHEMA from the dropdowns as shown below.

4 - Obtain your authentication credentials:
There are two methods to authenticate your app with Databricks: using interactive U2M OAuth or via registered M2M Service Principal. Choose one of the methods below to obtain the necessary credentials.
Interactive Login with your Databricks Account
If your Databricks account administrator has already added Reflex as an app connection in your Databricks account, you should see a "Login with Databricks" button after entering your DATABRICKS_HOST.
Step 2: Configure the Integration in Your App
- In Reflex Build, open the Integrations tab, select the Databricks card, and click Add connection.
- Paste your DATABRICKS_HOST.
- Select your authentication method:
- OAuth: click Login with Databricks. This button appears after a Databricks account admin registers the Connected App and its client ID is added on the card's OAuth tab (see How to Enable Login as an Admin).
- Service Principal: provide the client ID and secret gathered previously.
- Optionally pick a DATABRICKS_WAREHOUSE_ID, DATABRICKS_CATALOG, and DATABRICKS_SCHEMA from the dropdowns, which list what your credentials can access.
- Click Connect to save the connection.
Once connected, the AI Builder can execute queries directly against your Databricks environment.
Step 3: Notes
- Secure your credentials: Never expose client secrets in public code.
- Permissions: Ensure your user or service principal is assigned to the workspace and has CAN USE on the SQL warehouse and Unity Catalog permissions on the catalogs and tables the app queries.
- Combine with AI: Use query outputs to power models, summaries, or alerts in real time.
How to Enable Login as an Admin
- Login to Databricks
- Open the account console (Manage account in the workspace switcher)

- Go to Settings → App connections, open the Custom apps tab, and click Add connection

- Enter an Application Name, add the redirect URL that Reflex Build provides under Redirect URLs, under Access scopes click
Add scopeand addall-apis(Reflex Build requests it at sign-in) alongside the defaultopenid,email,profile, andoffline_accessscopes, leaveGenerate a client secretunchecked, and clickAdd. - URL:
https://build.reflex.dev/_reflex_oidc_databricks/authorization-code/callback

- Copy the client ID from the Connection created dialog (it is also listed in the Client ID column under App connections) and give it to whoever is connecting in Reflex Build. On the Databricks card's OAuth tab, they paste it into client_id and click Add; Login with Databricks then appears.