Forum Discussion

hanzo7's avatar
hanzo7
New Member
10 months ago
Solved

How to Embed a NL to SQL Chatbot using Fabric Data Agent / Copilot with On-Prem Data Gateway?

Hi everyone,

I’m exploring a solution architecture that uses Microsoft Fabric to provide Natural Language to SQL (NL2SQL) query capabilities over on-premises databases via Data Gateway. We want to build a chat-style UI in our own web app, where users can type queries like “Show me top 10 products by revenue last month”. The request should be processed by Fabric’s Copilot or Data Agent (NL2SQL) and return query results (not raw SQL) for display — e.g., as a table or chart.

Questions:

1. Is it possible to call Fabric Copilot or Data Agent through an API or SDK from a custom web application (outside Fabric UI)?

2. If yes, does Copilot only use metadata (schema/columns) to generate SQL, or does it ever transmit raw data to Microsoft’s models?

3. Can the results be returned through Fabric APIs securely (with Entra ID authentication)?

4. Has anyone successfully implemented a similar embedded NL2SQL chatbot or Copilot integration with Fabric yet?

5. Are there any licensing or capacity considerations when scaling this for multiple clients?

  •  

    • Is it possible to call Fabric Copilot or Data Agent through an API or SDK from a custom web application (outside Fabric UI)?
        Yes, fabric data agent/copilot can be called from custom apps via SDKs or APIs.

    • If yes, does Copilot only use metadata (schema/columns) to generate SQL, or does it ever transmit raw data to Microsoft’s models?
        Only metadata/schema is used; raw data stays on-premises.

    • Can the results be returned through Fabric APIs securely (with Entra ID authentication)?
        Yes, results can be securely returned via Fabric APIs with Entra ID.

    • Has anyone successfully implemented a similar embedded NL2SQL chatbot or Copilot integration with Fabric yet?
        Limited public examples exist, but embedding Data Agent in custom chat apps is supported.

    • Are there any licensing or capacity considerations when scaling this for multiple clients?
        Yes, you need Copilot capacity (F2+), manage per-user licenses, and scale Fabric SKUs appropriately.

    You can build a chat style NL2SQL UI securely over onprem data.

     

     

     

6 Replies

  •  

    • Is it possible to call Fabric Copilot or Data Agent through an API or SDK from a custom web application (outside Fabric UI)?
        Yes, fabric data agent/copilot can be called from custom apps via SDKs or APIs.

    • If yes, does Copilot only use metadata (schema/columns) to generate SQL, or does it ever transmit raw data to Microsoft’s models?
        Only metadata/schema is used; raw data stays on-premises.

    • Can the results be returned through Fabric APIs securely (with Entra ID authentication)?
        Yes, results can be securely returned via Fabric APIs with Entra ID.

    • Has anyone successfully implemented a similar embedded NL2SQL chatbot or Copilot integration with Fabric yet?
        Limited public examples exist, but embedding Data Agent in custom chat apps is supported.

    • Are there any licensing or capacity considerations when scaling this for multiple clients?
        Yes, you need Copilot capacity (F2+), manage per-user licenses, and scale Fabric SKUs appropriately.

    You can build a chat style NL2SQL UI securely over onprem data.

     

     

     

    • KevinChant's avatar
      KevinChant
      Super User

      Just to add a bit more detail to this, you can call Fabric Data Agents from Azure AI Foundry which you can then use with your custom apps if you so wish (Copilot Studio is also an option).

      You will need the appropriate licenses for either of these.

      Also, be aware that you will ned your databases ingested into Fabric in some form in order for this to work.

  • HI hanzo7,

    Thank you KevinChant Vinodh247, for your insights.

    You can embed an NL2SQL chat using Fabric Data Agent. It uses only metadata/schema, keeps raw data on-premises, executes queries securely with user credentials, and returns structured results via Fabric APIs with Entra ID. Multiple data sources are supported, requiring F2+/P1+ capacity.Below is the link for your reference:
    Fabric data agent creation (preview) - Learn how to create a Fabric data agent | Microsoft Learn

     

    Thank you.

    • KevinChant's avatar
      KevinChant
      Super User

      Just to check on this reply, are you advising that a Fabric Data Agent can connect directly to a database through a Data Gateway?

  • Hi hanzo7,

    Have you had a chance to review the solution we shared earlier? If the issue persists, feel free to reply so we can help further.

     

    Thank you.

  • Hi hanzo7,

    Have you had a chance to review the solution we shared earlier? If the issue persists, feel free to reply so we can help further.

     

    Thank you.