Forum Discussion

AK299792458's avatar
AK299792458
Copper Contributor
Mar 19, 2025

Having Copilot agent talk to on-prem SQL and answer questions

Hello. I am trying to see if it is possible to create a Copilot agent that can take a natural language question and pass it to on-prem SQL server as a query and then respond with an answer. For example, if I ask "What was the total sales last month?", I want Copilot to answer "$50,000" or something like that from the on-prem database and table(s) I specified beforehand.
I have a Microsoft Graph Connector (MS SQL Server) that is connected to an on-prem SQL server via a Graph Connector agent. The Graph Connector can access the SQL data and index it.
I have added the Graph Connector as knowledge source in Copilot agent. However, the agent does not seem to be able to answer questions using the data. Instead, it only suggests a generic SQL query that does not reference the database name or the table name. Is what I'm trying to do with Copilot possible?

Thank you.

1 Reply

  • PaxtonBlaze's avatar
    PaxtonBlaze
    Iron Contributor

    1. Use Hybrid Connectivity: Connect to your local SQL database through Azure Hybrid Connectivity Services.
    2. Use Local Data Gateway: Connect to your local SQL database through Power BI Data Gateway.
    3. Use API Middle Tier: Develop a custom API to connect to the local SQL database.
    4. Using Power Automate: Connect to a local SQL database through Power Automate.
    5. Use SQL Server's REST API: Access the database directly through SQL Server's REST API.
    6. Contact Microsoft Support: If none of the above methods work, it is recommended to contact Microsoft support team and provide detailed error messages and screenshots for further assistance.

Resources