Items marked preview in this article are currently in preview. This preview is provided without a service-level agreement, and Microsoft doesn’t recommend it for production workloads. Certain features might not be supported or might have constrained capabilities. For more information, see Supplemental Terms of Use for Microsoft Azure Previews.
See best practices for information on optimizing tool usage.
Prerequisites
- The model you select during agent setup is only used for orchestration and response generation. It doesn’t affect which model the Fabric data agent uses for NL2SQL.
- To help your agent invoke the Fabric tool reliably, include clear tool guidance in your agent instructions (for example, “For customer and product sales data, use the Fabric tool”). You can also force tool use with
tool_choice.
- Create and publish a Fabric data agent.
- Use a paid F2 or higher Fabric capacity, or a Power BI Premium P1 or higher capacity with Microsoft Fabric enabled.
- Configure cross-geo processing and storage tenant settings for Fabric data agents if your deployment requires them.
- Assign developers and end users at least the
Foundry UserAzure RBAC role. For more information, see Azure role-based access control in Foundry.
The Foundry RBAC roles were recently renamed. Foundry User, Foundry Owner, Foundry Account Owner, and Foundry Project Manager were previously named Azure AI User, Azure AI Owner, Azure AI Account Owner, and Azure AI Project Manager. You might still see the previous names in some places while the rename rolls out. The role IDs and core permissions are unchanged by the rename.
-
Give developers and end users at least
READaccess to the Fabric data agent. Users also need the minimum permission on each underlying data source:For full details, see Underlying data source permissions. - Ensure your Fabric data agent and Foundry project are in the same tenant.
- Keep the data agent and its data sources on capacities in the same region. The data agent can’t execute a query when a data source’s workspace capacity is in a different region.
- Use user identity authentication. Service principal authentication isn’t supported for the Fabric data agent.
-
Get these values before you run the samples:
- Your Foundry project endpoint:
FOUNDRY_PROJECT_ENDPOINT. - Your model deployment name:
FOUNDRY_MODEL_DEPLOYMENT_NAME. - Your Fabric connection ID (project connection ID):
FABRIC_PROJECT_CONNECTION_ID.
- Your Foundry project endpoint:
-
For the REST sample, also set:
-
AGENT_TOKEN(a bearer token). You can get a temporary token with Azure CLI:
-
Set up the Microsoft Fabric connection
In the Foundry portal, add the Microsoft Fabric data agent tool to your agent. You don’t need to create the connection separately in the management center. When you add the tool, Foundry prompts you for the Fabric data agent information and creates the project connection.- In Microsoft Fabric, open your data agent.
- Copy the
workspace_idandartifact_idvalues from the URL.
.../groups/<workspace_id>/aiskills/<artifact_id>.... Both values are GUIDs.
- In the Foundry portal, open your project.
- Create or open an agent, and then add the Microsoft Fabric data agent tool.
- Enter the
workspace_idandartifact_idvalues. - Complete the tool setup. Foundry creates the project connection.
- Copy the connection ID from the tool configuration.
FABRIC_PROJECT_CONNECTION_ID. The value looks like: /subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/Microsoft.CognitiveServices/accounts/<foundryAccountName>/projects/<foundryProjectName>/connections/<connectionName>.
Create the connection with the REST API
To automate connection creation, send an Azure Resource ManagerPUT request. The caller needs the Microsoft.CognitiveServices/accounts/projects/connections/write permission on the Foundry project.
Get an Azure Resource Manager access token:
id property is the project connection ID. Use this value for FABRIC_PROJECT_CONNECTION_ID in the agent samples.
Identity passthrough and access control
This integration uses identity passthrough (On-Behalf-Of). The Fabric tool runs queries by using the identity of the signed-in user.- Give each end user access to the Fabric data agent and its underlying data sources, or the tool call fails.
- Use user identity authentication. Service principal authentication isn’t supported for the Fabric data agent.
- For more information about how agent identity works, see Agent identity.