Microsoft Foundry Hosted Agent – Fabric Data Agent Tool fails with 400 tool_user_error despite successful Foundry authentication

Manudeep Yadav Vanneboina 0 Reputation points
2026-08-22T15:55:41.6933333+00:00

We are building a Microsoft Agent Framework (MAF) based hosted agent in Microsoft Foundry. The hosted agent orchestrates multiple Foundry prompt agents, and one of the agents (H_AnalysisAgent) uses a Microsoft Fabric Data Agent tool.

The architecture is:

User

Microsoft Foundry Hosted Agent

MAF Declarative Workflow

Router Agent

H_AnalysisAgent

Microsoft Fabric Data Agent Tool

Fabric semantic model/data

The Router agent works successfully, confirming that the hosted agent can authenticate to the Foundry project and invoke Foundry prompt agents.

However, when H_AnalysisAgent attempts to invoke the Fabric Data Agent tool, we receive:

Agent 'H_AnalysisAgent' invocation failed:

Error code: 400

{

"error": {

"message": "Create assistant failed: . Find out more troubleshooting details here - https://aka.ms/foundryfabrictroubleshooting",

"type": "invalid_request_error",

"param": null,

"code": "tool_user_error",

"request_id": "33935f862d81c6d9b4bc16220e8ecb21"

}

}

The Service Principal has been granted access to the required Fabric workspace/data resources.

The hosted agent container is configured with:

AZURE_TENANT_ID

AZURE_CLIENT_ID

AZURE_CLIENT_SECRET

and the application uses:

credential = DefaultAzureCredential()

Authentication to Foundry itself is successful.

For example, the Router agent executes successfully.

Foundry Agent Service
Foundry Agent Service

A fully managed platform in Microsoft Foundry for hosting, scaling, and securing AI agents built with any supported framework or model

0 comments No comments

2 answers

Sort by: Newest
  1. Manudeep Yadav Vanneboina 0 Reputation points
    2026-08-23T02:28:24.8466667+00:00

    Hi @Allan Solomon Mejia

    Thank you for the clarification.

    We have already provided all the required permissions to the end user, including access to the Fabric workspace, Fabric Data Agent, and underlying semantic model/data.

    Also, H_Analysis_Agent is a prompt agent, and when we invoke it directly from the Foundry Playground, the Fabric Data Agent works successfully.

    The same nested-agent architecture also works when we test it locally using az login credentials.

    The issue occurs specifically when the same architecture is deployed/hosted and invoked with the delegated end-user identity.

    Was this answer helpful?

    0 comments No comments

  2. Allan Solomon Mejia 7,995 Reputation points
    2026-08-22T22:24:01.0166667+00:00

    Hello @Manudeep Yadav Vanneboina

    Your Router Agent working confirms that DefaultAzureCredential() and the service principal can authenticate the hosted agent to the Foundry project, but it doesn't establish an identity that the Fabric Data Agent tool can use.

    The key limitation here is that Microsoft currently documents the Fabric Data Agent integration as using end-user identity passthrough (On-Behalf-Of/OBO). It specifically states that user identity authentication is required and service principal authentication isn't supported for the Fabric Data Agent tool.

    So in your architecture:

    Screenshot 2026-08-22 171848

    Granting the service principal additional permissions to the Fabric workspace or semantic model therefore won't necessarily resolve the 400 tool_user_error. The issue isn't simply whether the SP has Fabric permissions; it's that the Fabric tool expects a supported user identity context when it executes the query.

    Microsoft also states that the Fabric tool runs queries using the signed-in user's identity and that each end user needs access to both the Fabric Data Agent and its underlying data sources.

    This makes the error you're seeing during:

    Create assistant failed

    code: tool_user_error

    consistent with the Fabric tool being instantiated without the user identity context it requires.

    I would therefore test H_AnalysisAgent separately using an interactive/delegated user identity that has access to:

    1. The Foundry project.
    2. The published Fabric Data Agent.
    3. The underlying Fabric semantic model/data source.

    If that succeeds, you've isolated the problem to identity propagation from the MAF Hosted Agent, rather than the Fabric connection itself.

    Also verify that the Fabric Data Agent is published and that the Fabric Data Agent and Foundry project are in the same tenant. Microsoft lists both as prerequisites.

    For the hosted-agent architecture specifically, I would not try to solve this by placing AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, and AZURE_TENANT_ID in the container and granting the application progressively broader Fabric permissions. That still provides an application identity, while the Fabric integration currently expects the user's delegated identity.

    If you need fully unattended service-to-service execution with no signed-in user, the documented Fabric Data Agent tool integration doesn't currently support that authentication model. You would need either a different integration pattern that supports application identity, or confirmation from Microsoft that Hosted Agents provide a supported mechanism for propagating delegated user identity through this particular MAF orchestration path.

    Given that this is a Hosted Agent → Prompt Agent → Fabric Data Agent scenario and the Fabric integration is still in preview, if you are already supplying a delegated end-user token and still receive this error, I would recommend escalating it with the request_id: 33935f862d81c6d9b4bc16220e8ecb21

    That would require Microsoft to determine whether OBO identity propagation through this particular nested-agent architecture is currently supported.

    Sharing these references with you:

    Use the Microsoft Fabric data agent with Foundry agents

    Consume a data agent in Microsoft Foundry

    Help make this community better for everyone: if this answer resolved your issue, please accept it or leave an upvote. If not, share more details in a comment so we can continue the discussion and find the right solution.

    Was this answer helpful?


Your answer

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