Share via

Error 500/504 when using "Save as agent" to add Knowledge in Azure AI Foundry

IPA-Assistant 0 Reputation points
2026-04-27T22:43:59.0766667+00:00

Hi everyone,

I am currently working in the new Azure AI Foundry portal and experiencing a persistent issue when trying to implement data grounding. To add a Knowledge Base to my deployment, the interface requires me to use the "Save as agent" feature. However, every time I attempt to create the agent, the process hangs on a loading screen and eventually fails with a 500 Internal Server Error (and occasionally a 504 Gateway Timeout).

Given these errors and the deprecation of the legacy grounding features, I would like to know: What is the current recommended way to add knowledge bases for grounding to my models within the New Foundry?
User's image

Azure AI Search
Azure AI Search

An Azure search service with built-in artificial intelligence capabilities that enrich information to help identify and explore relevant content at scale.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Q&A Assist
    2026-04-27T22:44:16.4666667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    The recommended way to add knowledge bases for grounding in the new Azure AI Foundry is to:

    1. Create or connect a knowledge source (for example, an Azure AI Search–backed Foundry IQ knowledge base or other supported tools such as SharePoint Grounding, Browser Automation, or Language tools) as a connection in the Foundry project.
    2. Create an agent that uses this connection as a tool, instead of relying on the “Save as agent” flow in the playground UI.

    From the available guidance:

    • For Foundry IQ knowledge bases, connect Azure AI Search to the Foundry Agent Service and then configure the agent to use the MCP tool and knowledge_base_retrieve so the agent grounds answers on that data. If the agent does not ground answers, verify that the MCP endpoint and knowledge base name are correct and that the agent’s allowed_tools includes the knowledge tool.
    • For Azure Language, CLU, or CQA projects, create a connection that uses the Ocp-Apim-Subscription-Key header and attach that connection as a tool to the agent. If the agent returns authentication errors or does not use the language projects as expected, verify the key and that the projects are deployed and correctly referenced.
    • For other knowledge-style tools (SharePoint Grounding, Fabric Data Agent, Browser Automation, etc.), ensure they are added as supported tools to a prompt agent in the Agent SDK, since only prompt agents support these tools.

    Because the 500/504 errors occur in the “Save as agent” UI flow and not in the documented connection/agent model, the supported path is to:

    1. Add the appropriate connection in the project (for example, Foundry IQ, Azure Language, SharePoint, or other supported knowledge tools).
    2. Create or update an agent (via SDK/CLI or portal agent configuration) and attach the knowledge tool based on that connection.
    3. Test grounding by sending a conversation to the agent and verifying that responses use the knowledge base; if grounding fails, use the troubleshooting steps for Foundry IQ or Language tools (authorization, endpoint, API version, and tool configuration).

    References:

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.