Plan and manage an Azure AI solution 1.3 Manage, monitor, and secure AI systems

A prompt agent in Foundry Agent Service calls a Foundry IQ knowledge base through the MCP…

Study guide skill: Configure security, including managed identity, private networking, keyless credentials, and role policies

Question B2-003

A prompt agent in Foundry Agent Service calls a Foundry IQ knowledge base through the MCP tool. The project connection uses the project's managed identity (keyless), and the knowledge base doesn't use an LLM. Every retrieval fails with HTTP 403 from Azure AI Search. Which role assignment fixes this with least privilege?

Select one answer.

  • A Search Index Data Contributor on the search service, assigned to every end user of the agent
  • B Foundry Agent Consumer on the project, assigned to the search service's managed identity
  • C Search Index Data Reader on the search service, assigned to the project's managed identity ✓ Correct answer
  • D Cognitive Services User on the Foundry resource, assigned to the search service's managed identity

Answer: C

The project's managed identity authenticates the MCP calls to the knowledge base, so it needs Search Index Data Reader on the search service for read-only access, and the troubleshooting guidance for a 403 from Azure AI Search is to confirm that role. Search Index Data Contributor is needed only when the agent writes to indexes. Cognitive Services User for the search service's identity is required only when the knowledge base calls an LLM, and Foundry Agent Consumer controls who can call agents, not search access.

Deep dive

How it works

When a prompt agent reaches a Foundry IQ knowledge base through the MCP tool with a keyless project connection, the caller that Azure AI Search sees is the project's managed identity. That identity needs data-plane read access on the search service.

The setup on the connection page:

  1. On your project, create a system-assigned managed identity for interactions with Azure AI Search.
  2. On your search service, assign Search Index Data Reader to the project's managed identity for read-only access to search indexes.
  3. Only if the agent writes documents to indexes, also assign Search Index Data Contributor.
  4. Only if the knowledge base specifies an LLM, assign Cognitive Services User on the project's parent resource to the search service's managed identity, so search can call the model for query planning or answer synthesis.

The troubleshooting section matches the symptom exactly: if you get a 403 from Azure AI Search, confirm the project's managed identity has the Search Index Data Reader role on the search service.

The other options, and when you'd use them

  • Search Index Data Contributor for every end user: Wrong identity and too much access. The calls use the project's managed identity, and Contributor is only needed if the agent writes documents to indexes.
  • Foundry Agent Consumer for the search service's identity: That role grants access to interact with agent endpoints in a Foundry project. It controls who can call agents, not what the project can read in search.
  • Cognitive Services User for the search service's identity: This assignment is conditional. It's required only if the knowledge base specifies an LLM, and this one doesn't. It also points the other way: search calling the model, not the project calling search.

Exam tip

403 from Azure AI Search on a keyless Foundry IQ connection = give the project's managed identity Search Index Data Reader. Contributor only for writes; Cognitive Services User only when the knowledge base uses an LLM.

References

Last reviewed:

Ready to test yourself? The quiz asks this and every other AI-103 question, with instant feedback. Practice this in a quiz →

All Plan and manage questions · AI-103 study guide

Thanks for your feedback!