An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
Hello Kumar, Kiran,
What’s really happening
You’re trying to make:
Azure OpenAI → Azure AI Search using Managed Identity
The Managed Identity is valid
Azure AI Search is reachable
But Search returns 403 (authorization failure)
OpenAI wraps it as 400 Bad Request
Switching to API key works instantly
This proves:
- Query logic is correct
- Index + schema are correct
- SDK usage is correct
- Issue is specifically with Managed Identity in this integration path
Key point
End-to-end Managed Identity support for Azure OpenAI → Azure AI Search (built-in retrieval / “On Your Data”) is NOT fully supported today
Even though:
- Azure AI Search supports AAD + RBAC
- Managed Identity works with Search directly
- Your roles are correctly assigned
The Azure OpenAI retrieval/cognitive search integration currently expects an API key, not Managed Identity.
So what you’re hitting is not a misconfiguration it’s a product limitation / gap.
Why you still see 403
When you test MI directly against Search:
- Token reaches Search
- But request is rejected with 403
This typically happens because:
- The request path used by OpenAI’s retrieval feature does not fully honor MI-based auth yet
- Or it doesn’t pass the token in the expected way for Search data-plane authorization
So even with correct RBAC Search treats it as unauthorized
If MI were fully supported, this is what would matter
These are still valid checks
- Search configuration
- Enable RBAC mode (AAD auth), not just API keys
- Ensure data-plane access is allowed via AAD
- Role assignments
Assign to Azure OpenAI Managed Identity
- Search Index Data Reader - for queries
- Search Index Data Contributor - if indexing
- Scope - Search resource level
- Allow ~5–10 mins for propagation
- Identity validation
- Confirm System-assigned MI is enabled on OpenAI
- Ensure the same identity has roles on Search
- Token audience
Must be:
https://search.azure.com/
Wrong audience - 403 even if roles are correct
- SDK usage
-
DefaultAzureCredentialis correct - No special handling required for Managed Identity
- Keep SDKs updated:
- Azure.AI.OpenAI ≥ 2.1.0
- Azure.Search.Documents ≥ 11.x
There’s no major bug in Azure AI Search rejecting valid tokens
The gap is:
Azure OpenAI’s built-in retrieval / “On Your Data” pipeline does not yet expose or fully support Managed Identity authentication to Search
That’s why:
- Direct MI usage - fails
- API key - works
Recommended approach
1.Continue using Search API key for OpenAI - Search, Keep everything else unchanged
2.Introduce a small middle layer:
Azure OpenAI → Azure Function (Managed Identity) → Azure AI Search
- Azure Function uses Managed Identity to call Search
- OpenAI calls the Function instead of Search directly
- No API keys exposed
- Fully compliant with MI-based security
This is the most common workaround in enterprise setups
Answers to your questions
Is end-to-end MI supported?
Not for Azure OpenAI retrieval / Search integration today
Supported only when you call Search directly yourself
Are permissions missing?
Based on your description: No, Roles and setup look correct
Any SDK-specific requirement?
No special configuration beyond DefaultAzureCredential -Just ensure latest SDK versions
Known issues?
Not a bug, but a known product limitation / gap - Documentation is fragmented, which causes confusion
Please refer this
Configure Search to use MI (system vs. user): https://learn.microsoft.com/azure/search/search-how-to-managed-identities
Search RBAC client-code troubleshooting: https://learn.microsoft.com/azure/search/search-security-rbac-client-code#troubleshoot-common-errors
OpenAI MI authentication guide: https://learn.microsoft.com/azure/ai-foundry/openai/how-to/managed-identity
I Hope this helps. Do let me know if you have any further queries.
Thank you!