An Azure service that provides a hybrid, multi-cloud management platform for APIs.
Likely cause: APIM is intermittently reaching a different backend target than Azure AI Search (or a differently routed path), which can explain fast HTML failures with ASP.NET Core 500.30 instead of Search JSON responses.
Why this fits your data:
- Direct calls to Azure AI Search succeed.
- Failed APIM responses are HTML with ASP.NET Core startup signature, not typical Search error payload.
- The same APIM operation alternates between success and failure, which points to routing or resolution variance.
Diagnostic branches:
- DNS/private endpoint resolution differs across APIM paths.
- APIM policy conditionally changes backend URL or headers.
- Mixed public/private network path to Search causes inconsistent backend reachability.
Recommended steps:
- Compare successful vs failed APIM traces for final backend URL and Host header.
- Enable APIM diagnostics/resource logs and correlate failed calls by timestamp.
- Validate Search endpoint networking model is consistent:
- public endpoint + firewall allow rules, or
- private endpoint + correct private DNS and VNet path.
- Review APIM policies for conditional backend rewrite rules.
- If issue persists, open Azure support with sanitized traces and exact UTC times.
Validation checks:
- Run repeated test calls and classify by response content-type and status.
- Confirm all failed calls map to one backend path pattern.
- After DNS/policy fixes, verify failures disappear across APIM units.
References:
- Azure API Management virtual network concepts: https://learn.microsoft.com/en-us/azure/api-management/virtual-network-concepts
- Monitor APIs in API Management: https://learn.microsoft.com/en-us/azure/api-management/api-management-howto-use-azure-monitor
- Configure network access for Azure AI Search: https://learn.microsoft.com/en-us/azure/search/service-configure-firewall
- Create private endpoint for Azure AI Search: https://learn.microsoft.com/en-us/azure/search/service-create-private-endpoint
“If you find this answer helpful, please upvote it. If this resolves your issue, please mark it as the accepted answer so that it can help others in the community.”