How to allow copilot agent to execute SQL queries in Azure SQL server?

Tomer Shanny 0 Reputation points
2025-04-10T12:45:51.18+00:00

Hey,

We’ve developed a custom agent using Copilot and are attempting to integrate it with our Azure-hosted SQL Server. To enable this, we used the existing action titled “Execute a SQL Query” in our Copilot setup. The initial connection to the SQL Server appears successful (the connector status shows a green check icon), but when the agent attempts to run a query, using the correct server name and database name - we encounter the following error:

Error Message: The connector 'SQL Server' returned an HTTP error with code 400. Error Code: ConnectorRequestFailure

We’d appreciate your guidance on properly configuring and authorizing our custom Copilot agent to run queries against an Azure SQL database.

Microsoft Copilot
Microsoft Copilot
Microsoft terminology for a universal copilot interface.
807 questions
{count} votes

1 answer

Sort by: Most helpful
  1. keshav-msft 0 Reputation points Microsoft External Staff
    2025-04-14T06:26:15.03+00:00

    Hi Tomer Shanny,
    Thanks for asking your query.
    Here I have attached the documentation links which can help you to deal with this problem:
    Copilot in Azure with Azure SQL Database
    Copilot sample prompts.
    https://learn.microsoft.com/en-us/microsoft-copilot-studio/copilot-plugins-overview
    Thanks, 

    Keshav

    ************************************************************************* 

    If the response is helpful, please click "Accept Answer" and upvote it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.