An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
Hello @AbigailIreland-5813 ,
Welcome to Microsoft Q&A .Thank you for reaching out to us.
The behaviour described is consistent with failures occurring before the requests are admitted by the service, which is why the resource metrics show only successful responses while the probes record 500 errors.
Metrics capture only those requests that the service accepts and processes, so errors that never appear in telemetry usually originate along the path between the calling application and Azure. The concurrency threshold around eight in-flight requests, combined with identical behaviour across minimal and production-like payloads, points in the same direction, since a model-side failure would normally vary with payload shape rather than with the number of open connections.
Please note that
- If apim-request-id or x-ms-request-id is present, the request reached the Azure OpenAI gateway and is traceable in backend telemetry.
- If the header is absent, or the body is not the standard Azure OpenAI JSON error format, the 500 was generated locally by the Functions host, an SDK wrapper, a proxy, or a TLS-inspecting agent.
In a locally hosted Function App, the most common contributors are an unhandled exception, timeout or cancellation inside the function that the local runtime surfaces as HTTP 500; connection pool exhaustion caused by creating a new client instance per request; interference from a corporate proxy, VPN or security agent during simultaneous TLS handshakes; and a short client-side timeout that aborts calls as latency rises under load. Transient service-side 500 and 503 responses are documented and are addressed by retry with exponential backoff, though these would normally be visible in the metrics, so that remains a secondary possibility until the request IDs confirm otherwise.
Recommended steps, in order:
- Capture apim-request-id, x-ms-request-id, full response headers, raw body and exact UTC timestamp for three to five failures. These identifiers are required for any backend trace.
- Enable diagnostic settings on the resource (Audit Logs, Request and Response Logs, AllMetrics) to a Log Analytics workspace, then query the failure window.
- Under Monitoring, chart Requests split by StatusCode and ModelDeploymentName at one-minute granularity, and cross-check Resource Health for the same period.
- Apply the following client adjustments:
- Reuse a single HTTP or Azure OpenAI client instance across requests.
- Raise the connection limit.
- Confirm HTTP/2 is in use.
- Increase the client timeout to at least 120 seconds during testing.
- Reproduce the test in three configurations for comparison: a plain script at eight concurrency from the same machine, the same script from an Azure VM, and the Function App deployed to Azure rather than run locally.
- Confirm the deployment has sufficient TPM and RPM headroom, and check whether any 429 responses are being masked by retry logic.
- Retain retries with backoff and jitter, and log each retry outcome to separate transient failures from structural ones.
The following references might be helpful , please check them out
- Troubleshoot common HTTP errors - Azure OpenAI in Microsoft Foundry - Microsoft Foundry | Microsoft Learn
- Azure OpenAI frequently asked questions | Microsoft Learn
- Diagnostic Settings in Azure Monitor - Azure Monitor | Microsoft Learn
- Azure Resource Health overview - Azure Service Health | Microsoft Learn
Please let us know if the response was helpful
Thank you