Chapter 36 · Microsoft Foundry
Subchapter 36.32
foundry-agent/create/references/tools/prompt-agent/tool-azure-ai-search.mdMarkdown3 KBView on GitHub
Ground agent responses with data from an Azure AI Search vector index. Requires a project connection and proper RBAC setup.
Edm.String fields (searchable + retrievable)Collection(Edm.Single) vector fields (searchable)azure-ai-projects package (pip install azure-ai-projects --pre)For keyless authentication (recommended), assign these roles to the Foundry project’s managed identity on the Azure AI Search resource:
| Role | Scope | Purpose |
|---|---|---|
| Search Index Data Contributor | AI Search resource | Read/write index data |
| Search Service Contributor | AI Search resource | Manage search service config |
If RBAC assignment fails: Ask the user to manually assign roles in Azure portal → AI Search resource → Access control (IAM). They need Owner or User Access Administrator on the search resource.
A project connection between your Foundry project and the Azure AI Search resource is required. See Project Connections for connection management via Foundry MCP tools.
| Value | Description |
|---|---|
SIMPLE | Keyword search |
VECTOR | Vector similarity only |
SEMANTIC | Semantic ranking |
VECTOR_SIMPLE_HYBRID | Vector + keyword |
VECTOR_SEMANTIC_HYBRID | Vector + keyword + semantic (default, recommended) |
| Parameter | Required | Description |
|---|---|---|
project_connection_id | Yes | Connection ID (resolve via project_connection_get, typically after discovering the connection with project_connection_list) |
index_name | Yes | Search index name |
top_k | No | Number of results (default: 5) |
query_type | No | Search type (default: vector_semantic_hybrid) |
filter | No | OData filter applied to all queries |
| Error | Cause | Fix |
|---|---|---|
| 401/403 accessing index | Missing RBAC roles | Assign Search Index Data Contributor + Search Service Contributor to project managed identity |
| Index not found | Name mismatch | Verify AI_SEARCH_INDEX_NAME matches exactly (case-sensitive) |
| No citations in response | Instructions don’t request them | Add citation instructions to agent prompt |
| Wrong connection endpoint | Connection points to different search resource | Re-create connection with correct endpoint |