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.

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.
  • Go to SQL Warehouses from 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.

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.

If your workspace administrator has already added Reflex as a Connected App in your Databricks workspace, you should see a "Login with Databricks" button after entering your DATABRICKS_HOST.

  1. In your app, go to Integrations and Add Databricks.
  2. Paste your DATABRICKS_HOST
  3. Select your authentication method:
    • OAuth, if configured.
    • Service Principal, provide the client ID and secret gathered previously.
  4. Paste or select your
    1. DATABRICKS_WAREHOUSE_ID
    2. DATABRICKS_CATALOG
    3. DATABRICKS_SCHEMA
  5. Click Connect to validate and save your integration.

Once connected, the AI Builder can execute queries directly against your Databricks environment.

  • Secure your token: Never expose tokens in public code.
  • Permissions: Ensure your token or service account has the required workspace and table permissions.
  • Combine with AI: Use query outputs to power models, summaries, or alerts in real time.
  • Login to Databricks
  • Go to manage account
  • Go to SettingsApps ConnectionsAdd new connection
  • Give it a name, enter the redirect URL that Reflex Build provides, Click All APIs and uncheck Generate a client secret and then add.
    • URL: https://build.reflex.dev/_reflex_oidc_databricks/authorization-code/callback

Built with Reflex