FabricFabric
Databricks

Databricks

Connect Fabric Agents to Databricks workspaces via PAT or OAuth. Explore Unity Catalog, run queries, scaffold projects with Fabric Harness, and deploy Databricks Apps — all from the chat surface.

The Databricks integration lets Fabric Agents query your Lakehouse, scaffold projects, and deploy workloads without leaving the chat. It supports three auth methods — PAT (quick start), M2M OAuth (production automation), and U2M OAuth (interactive user consent) — and delegates build/deploy to Fabric Harness (fh) via a built-in bridge.

Note: This section covers the Databricks workspace integration (sources, discovery, harness, templates). For using Databricks Mosaic AI as the agent's LLM provider, see Databricks Mosaic AI provider.

What it provides

  • Workspace exploration — list catalogs, schemas, tables, clusters, jobs, and SQL warehouses via the Databricks REST API.
  • Unity Catalog governance — read tags, lineage, and privileges; the agent inherits your UC grants.
  • SQL execution — run queries through SQL warehouses using the Statement Execution API.
  • Project scaffolding — fabric-cli databricks init generates a Databricks Asset Bundle (DAB) project via Fabric Harness.
  • Mock runs — validate structure and syntax without live API calls.
  • Deploy targets — build for databricks-app or databricks-serving and preview deploy before going live.
  • Source discovery — the agent discovers catalogs, schemas, tables, warehouses, clusters, and jobs automatically, and uses them to pre-fill scaffolded projects.
  • Live health tests — source test validates connectivity, credentials, and permissions in real time.
  • Three workload templates — Governed Analytics Copilot, Lakebase Stateful RAG Agent, and Data Engineering Agent.

How it fits together

flowchart TB
    subgraph Desktop["Fabric Agents"]
        Chat["Chat UI / fabric-cli"]
        Source["Databricks source<br/>PAT / M2M / U2M OAuth"]
        Bridge["Harness bridge"]
    end

    subgraph Databricks["Databricks workspace"]
        UC["Unity Catalog<br/>catalogs / schemas / tables"]
        SQLW["SQL warehouses"]
        Compute["Clusters / Jobs"]
        AI["Genie / Vector Search /<br/>Mosaic AI Serving"]
        Apps["Databricks Apps /<br/>Model Serving endpoints"]
    end

    Chat -->|"discovery + queries"| Source
    Source -->|"REST API"| UC
    Source -->|"REST API"| SQLW
    Source -->|"REST API"| Compute
    Chat -->|"init / run / build / deploy"| Bridge
    Bridge -->|"fh CLI"| Apps
    Apps --> UC
    Apps --> AI

Two paths share the same credentials:

  1. Direct workspace access — the chat agent calls Databricks REST APIs through your configured source: Unity Catalog discovery, SQL execution, cluster/job listing, and health checks. Everything is governed by your UC grants and the source's permission rules.
  2. The harness bridge — fabric-cli databricks (or the databricks_harness_invoke session tool) delegates scaffolding, mock runs, builds, and deploys to the Fabric Harness CLI (fh). The bridge strips unrelated secrets from the child environment, redacts tokens from output, and gates live runs behind FABRIC_DATABRICKS_TEST=1.

Prerequisites

  • A Databricks workspace URL (e.g. https://mycompany.cloud.databricks.com).
  • One of the following:
    • A Personal Access Token (PAT) with at least BROWSE on Unity Catalog and CAN VIEW on clusters/jobs.
    • A service principal with OAuth secrets and workspace permissions (see M2M OAuth setup).
    • An OAuth app registered in your Databricks workspace for user-to-machine (U2M) consent (see U2M OAuth setup).
  • (Optional) The Fabric Harness CLI (fh) installed and on your PATH for scaffolding and deploy.

10-minute happy path

  1. Create a PAT in Databricks: User Settings → Access tokens → Generate new token.
  2. Add the source in Fabric Agents:
    fabric-cli source create --name "Databricks" --provider databricks --type api \
      --base-url "https://<workspace-host>.cloud.databricks.com/" --auth-type bearer
  3. Test the connection:
    fabric-cli source test databricks-pat
    When prompted, paste your PAT. The test hits api/2.0/preview/scim/v2/Me.
  4. Explore — ask the agent: "List catalogs in my Databricks workspace" or "Show tables in main.default".
  5. Scaffold a template (requires fh):
    fabric-cli databricks init --template governed-analytics-copilot
  6. Run in mock mode:
    fabric-cli databricks run --mock --question "What tables are in main?"
  7. Set the live gate and run for real:
    export FABRIC_DATABRICKS_TEST=1
    export DATABRICKS_HOST="https://<workspace-host>.cloud.databricks.com"
    export DATABRICKS_TOKEN="dapi..."
    fabric-cli databricks run --question "What tables are in main?"

On this page