Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
You can add Azure SQL tables and views as a knowledge source in Copilot Studio. Your agent can answer questions by reading structured data from your Azure SQL database, using the configured connection and database permissions.
Views appear in the same selection list as tables. You don't need a separate knowledge source type to add a view.
Note
The identity you use to authenticate the SQL connection must have permission to access the database and list and read the selected tables and views. Missing or insufficient permissions can prevent servers, databases, tables, or views from appearing during setup.
Prerequisites
- An Azure SQL Database or Azure SQL Managed Instance that your organization can reach from Power Platform.
- Credentials that can connect to the database and list and read the tables and views you plan to add. For example, use Microsoft Entra ID or SQL Server authentication, depending on your connection configuration.
- Access to Copilot Studio and permission to edit the agent.
- Network access configured so Power Platform can reach your Azure SQL server. For example, use firewall rules that allow Azure services, or private connectivity as required by your organization.
Permissions and authentication
Azure SQL knowledge uses the Power Platform SQL connection you create or select during setup. At runtime, the agent relies on the agent user's Microsoft authentication and the access granted through that connection path.
- Users only receive answers based on data the maker can access through the maker's configured connection and database permissions.
- If tables or views don't appear during setup, verify that the connection works outside Copilot Studio. Use the same authentication type and identity to confirm that you can list and read the required tables and views.
For SQL Server authentication, permissions apply to the SQL user you specify when you create the connection. For other authentication types, verify permissions for the identity used by that connection.
Prepare your Azure SQL database
Copilot Studio agents support Azure SQL databases or SQL Server. Before you add tables or views, check the following configuration:
- Use clear, descriptive column names in tables and views to help the agent understand the data. Avoid cryptic abbreviations. For example, use
CustomerNameinstead ofCustNm, andOrderDateinstead ofDate1. - Define a primary key for each table. The agent uses primary keys to identify rows and return results.
- Create any views you plan to use before you select them in Copilot Studio. Confirm that the connection identity can list and read each view.
Add Azure SQL tables and views to your agent
To add Azure SQL tables and views as a knowledge source, complete the following steps:
Open your Copilot Studio agent.
Select the Build tab.
In the components panel, select Knowledge.
In the Add knowledge dialog, select Azure SQL (or SQL Server, depending on the label shown in your environment).
Create or select a connection to your Azure SQL database:
- If you don't already have a connection, select Create new connection (or Add connection).
- Enter the server name and database name for your Azure SQL resource.
- Choose the authentication type required by your organization. Sign in or provide credentials, and then create the connection.
- Confirm that the identity you use to authenticate the connection has permission to list and read the tables and views you plan to add.
- If a connection already exists, select it from the list and continue.
Locate one or more tables or views to add. Tables and views appear in the same selection list. Use the search field to narrow the list, and then select the tables and views you want the agent to use.
Note
Select only the tables and views needed to answer user questions. Use clear table, view, and column names. If you create a view after opening the selection list, reopen the Azure SQL knowledge setup to load the list again.
Review the knowledge name and description. Provide a detailed description to help the agent understand the data and determine when to use this knowledge source.
Select Add to agent to finish adding the knowledge source.
After you add the knowledge source
After you add Azure SQL:
- Confirm that the knowledge source appears on the agent's Knowledge page with the configured connection and selected tables and views.
- Publish the agent so the knowledge source is available in the published experience.
- Test your agent with questions that the selected tables and views can answer. For example, "Show me the top five customers by total sales last month." If results are empty or incorrect, ensure that the selected table or view returns the expected data and that the query matches your schema.
Tip
Create a diagnostic view in Azure SQL that returns a small, known dataset. Confirm that the connection identity can list and read the view, then select it as a knowledge source. Test questions about that dataset before using production data.
Improve answer quality
Clear names and descriptions help the agent determine when and how to use your Azure SQL data.
- Knowledge source name: Use a specific name that identifies the business area. For example, use "Customer orders - Azure SQL" rather than a generic name.
- Description: Explain what data the tables and views provide, which business questions they answer, and any important filters or relationships.
- Tables and views: Select only relevant tables and views. Unnecessary sources can make it harder for the agent to select the correct data.
- Schema names: Use clear, business-friendly names for tables, views, and columns to help the agent interpret the data.
Example description
The following example shows a description that helps generative orchestration select the right knowledge source:
Azure SQL knowledge for Contoso order management. Includes the Customers, Orders, and OrderLines tables. Use this source for questions about order status, order history, customer purchases, product quantities ordered, and revenue by customer or date. Don't use this source for inventory on-hand or shipping carrier tracking.