Forum Discussion
Uzmakhan
Sep 08, 2025Copper Contributor
Agent in Azure AI Foundry not able to access SharePoint data via C# (but works in Foundry portal)
Hi Team, I created an agent in Azure AI Foundry and added a knowledge source using the SharePoint tool. When I test the agent inside the Foundry portal, it works correctly; it can read from the Shar...
pradejain
Sep 10, 2025Iron Contributor
The most common reason for the “Run status: failed” error is that the SharePoint tool isn’t properly bound to the agent during your programmatic call. Even if the agent was created with the tool, you still need to make sure the connection ID is passed correctly, and that your message actually references the SharePoint resource in a way the agent understands.
Also, permissions matter. The identity you're using in your C# app (like DefaultAzureCredential) needs to have access to both the Azure AI Foundry project and the SharePoint site. If it doesn’t, the agent can’t reach the data—even though it works in the portal where your identity is already authorized.