Skip to main content
⚠️ 429 Too Many Requests Azure OpenAI / Microsoft Foundry .NET 10 ✓ Verified Oct 2026

Fix: Azure OpenAI 429 Requests Exceeded Rate Limit (TPM/RPM)

Fix Azure OpenAI 429 rate limit exceeded error in C#. Implement Polly exponential backoff with jitter and token bucket rate smoothing.

Raw Error Payload / Console String
{
  "error": {
    "code": "429",
    "message": "Requests to the ChatCompletions_Create Operation Under Azure OpenAI API Have Exceeded Token Rate Limit of Your Current OpenAI S0 Pricing Tier. Please retry after 12 seconds."
  }
}

Trigger Scenario

Concurrent requests exceed the allocated Tokens Per Minute (TPM) or Requests Per Minute (RPM) quota on your Azure OpenAI model deployment.

Root Cause

Azure OpenAI enforces strict token-bucket rate limits per deployment. Sudden traffic spikes or parallel batch calls exhaust available tokens before refill windows reset.

Step-by-Step Resolution

1
Read Retry-After header Extract the HTTP 429 response Retry-After header and pause execution before retrying.
2
Add Polly resilience pipeline Wrap AzureOpenAIClient calls with Polly AddRetry configuring exponential backoff with random jitter.
3
Deploy multiple model instances Implement round-robin routing across secondary regional deployments to spread load.
Verified C# (.NET 10) Solution Code
using Azure;
using Azure.AI.OpenAI;
using Polly;
using Polly.Retry;

var pipeline = new ResiliencePipelineBuilder()
    .AddRetry(new RetryStrategyOptions
    {
        MaxRetryAttempts = 4,
        Delay = TimeSpan.FromSeconds(2),
        BackoffType = DelayBackoffType.Exponential,
        UseJitter = true,
        ShouldHandle = new PredicateBuilder().Handle<RequestFailedException>(ex => ex.Status == 429)
    })
    .Build();

var response = await pipeline.ExecuteAsync(async ct =>
{
    return await chatClient.CompleteChatAsync("Generate summary", cancellationToken: ct);
});
Comprehensive Engineering Guide

Fix Azure OpenAI 429 Too Many Requests in C#: Polly Retry & Circuit Breaker

Read Full Deep Dive