Skip to main content

Azure AI Search 429 and Indexing Fix

Verified Apr 2026 Intermediate Original .NET 10 Azure.Search.Documents 11.7.0
By Rajesh Mishra · Mar 12, 2026 · 8 min read
In 30 Seconds

Troubleshooting guide for the three most common Azure AI Search errors in .NET: HTTP 429 throttling, index-not-found errors, and field mapping mismatches during indexing. Provides root causes, code fixes, and prevention strategies for each.

⚠️
Error Fix Guide

Root cause analysis and verified fix. Code examples use Azure.Search.Documents 11.7.0.

✓ SOLVED

Fixes at a Glance

  1. HTTP 429 Rate Limit — use exponential backoff with a SemaphoreSlim batch limiter and add a distributed cache in front of Search to reduce effective QPS
  2. Index Not Found — verify the index name exactly matches the Azure portal value (case-sensitive) and confirm the index has been fully provisioned before querying
  3. Field Mapping Mismatch — align your SearchDocument field names and types with the index schema; check vector field dimensions match your embedding model’s output

Error 1: HTTP 429 — Request Rate Too Large

What You See

Azure.RequestFailedException: Service request failed.
Status: 429 (Too Many Requests)

Headers:
  Retry-After: 2

Or in your application logs:

RequestFailedException: The request rate is too large. 
Please try again later or consider scaling up your service.

Why It Happens

Every Azure AI Search tier has a queries-per-second (QPS) ceiling:

TierApproximate QPSIndexing Throughput
Free3Very limited
Basic15~300 docs/sec
Standard S150~1,500 docs/sec
Standard S2100+~3,000 docs/sec

The 429 fires when your cumulative request rate (queries + indexing + management operations) exceeds these limits.

The Fix

Step 1: Configure retry policies (handles transient spikes)

using Azure;
using Azure.Search.Documents;

var options = new SearchClientOptions
{
    Retry =
    {
        MaxRetries = 5,
        Mode = RetryMode.Exponential,
        Delay = TimeSpan.FromSeconds(1),
        MaxDelay = TimeSpan.FromSeconds(30),
        NetworkTimeout = TimeSpan.FromSeconds(60)
    }
};

var searchClient = new SearchClient(
    new Uri(endpoint),
    "my-index",
    new AzureKeyCredential(apiKey),
    options);

The SDK respects the Retry-After header. Exponential backoff starts at 1 second, doubles each retry, caps at 30 seconds.

Step 2: Batch indexing operations

The biggest QPS consumer is usually indexing. Instead of one document per request, batch them:

var indexClient = searchClient.GetSearchIndexClient();
var batch = IndexDocumentsBatch.Create<SearchDocument>();

foreach (var document in documents)
{
    batch.Actions.Add(IndexDocumentsAction.Upload(document));

    // Flush every 1,000 documents
    if (batch.Actions.Count >= 1000)
    {
        await searchClient.IndexDocumentsAsync(batch);
        batch = IndexDocumentsBatch.Create<SearchDocument>();
        await Task.Delay(500); // Brief pause between batches
    }
}

// Flush remaining
if (batch.Actions.Count > 0)
    await searchClient.IndexDocumentsAsync(batch);

Step 3: Cache repeated queries

using Microsoft.Extensions.Caching.Distributed;

public class CachedSearchService
{
    private readonly SearchClient _searchClient;
    private readonly IDistributedCache _cache;

    public CachedSearchService(SearchClient searchClient, IDistributedCache cache)
    {
        _searchClient = searchClient;
        _cache = cache;
    }

    public async Task<SearchResults<T>> SearchAsync<T>(string query, SearchOptions options)
    {
        // Cache key based on query and options
        var cacheKey = $"search:{query}:{options.Filter}:{options.Top}";
        var cached = await _cache.GetStringAsync(cacheKey);

        if (cached is not null)
            return JsonSerializer.Deserialize<SearchResults<T>>(cached)!;

        var results = await _searchClient.SearchAsync<T>(query, options);

        // Cache for 5 minutes
        await _cache.SetStringAsync(cacheKey,
            JsonSerializer.Serialize(results.Value),
            new DistributedCacheEntryOptions
            {
                AbsoluteExpirationRelativeToNow = TimeSpan.FromMinutes(5)
            });

        return results;
    }
}

Error 2: Index Not Found

What You See

Azure.RequestFailedException: Service request failed.
Status: 404 (Not Found)

No index with the name 'my-index' was found in the search service.

Why It Happens

Three common causes:

  1. Typo in the index name — Index names are case-sensitive
  2. Wrong endpoint — Your code points to a different Azure AI Search instance
  3. Race condition — Index creation is async; your query runs before creation finishes

The Fix

Verify the index exists before querying:

using Azure.Search.Documents.Indexes;

var indexClient = new SearchIndexClient(
    new Uri(endpoint),
    new AzureKeyCredential(apiKey));

try
{
    var index = await indexClient.GetIndexAsync("my-index");
    Console.WriteLine($"Index '{index.Value.Name}' exists with {index.Value.Fields.Count} fields");
}
catch (RequestFailedException ex) when (ex.Status == 404)
{
    Console.WriteLine("Index does not exist. Creating...");
    // Create the index here
}

Handle creation timing:

// After creating the index, verify it's ready
await indexClient.CreateOrUpdateIndexAsync(indexDefinition);

// Poll until index is available (usually under 5 seconds)
var ready = false;
for (var attempt = 0; attempt < 10 && !ready; attempt++)
{
    try
    {
        await indexClient.GetIndexAsync(indexDefinition.Name);
        ready = true;
    }
    catch (RequestFailedException ex) when (ex.Status == 404)
    {
        await Task.Delay(1000);
    }
}

if (!ready)
    throw new InvalidOperationException($"Index '{indexDefinition.Name}' was not ready after 10 seconds");

Error 3: Field Mapping Mismatch

What You See

Azure.RequestFailedException: Service request failed.
Status: 400 (Bad Request)

The property 'ContentVector' does not exist on type 'search.document'. 
Make sure to only use property names that are defined by the type.

Or during indexing:

A document in the batch could not be indexed. 
Key: 'doc-001' Error: 'Field 'content_vector' was not found in the index schema.'

Why It Happens

The field names in your C# model don’t match the field names defined in the Azure AI Search index. Common mismatches:

C# PropertyIndex FieldProblem
ContentVectorcontent_vectorCasing/naming convention
IdidC# uses PascalCase, index uses camelCase
Embedding(missing)Field exists in C# but not in index

The Fix

Use JsonPropertyName or SearchableField attributes to match field names:

using System.Text.Json.Serialization;
using Azure.Search.Documents.Indexes;

public class SearchDocument
{
    [SimpleField(IsKey = true, IsFilterable = true)]
    [JsonPropertyName("id")]
    public string Id { get; set; } = string.Empty;

    [SearchableField]
    [JsonPropertyName("content")]
    public string Content { get; set; } = string.Empty;

    [SimpleField(IsFilterable = true)]
    [JsonPropertyName("category")]
    public string Category { get; set; } = string.Empty;

    [VectorSearchField(VectorSearchDimensions = 1536, VectorSearchProfileName = "default-profile")]
    [JsonPropertyName("content_vector")]
    public IReadOnlyList<float>? ContentVector { get; set; }
}

Validate your model against the index schema:

var index = await indexClient.GetIndexAsync("my-index");
var indexFields = index.Value.Fields.Select(f => f.Name).ToHashSet();

// Check that all required fields exist
var requiredFields = new[] { "id", "content", "category", "content_vector" };
var missing = requiredFields.Where(f => !indexFields.Contains(f));

if (missing.Any())
{
    throw new InvalidOperationException(
        $"Index is missing fields: {string.Join(", ", missing)}");
}

Prevention Checklist

  1. Pin your index name in configuration, not inline strings — IConfiguration["Search:IndexName"]
  2. Log the SearchClient endpoint on startup so you can verify which service you’re connected to
  3. Set retry policies on every SearchClientOptions instance
  4. Use JsonPropertyName attributes on all C# model properties to make field mapping explicit
  5. Monitor QPS in Azure Portal → Metrics → Search Requests per Second

⚠ Production Considerations

  • Azure AI Search index creation is asynchronous. Calling SearchClient.SearchAsync() immediately after CreateOrUpdateIndexAsync() can fail with index-not-found. Add a brief polling check or use a circuit breaker pattern for the initial query.
  • Free tier Azure AI Search shares infrastructure with other tenants. Your QPS capacity fluctuates. Don't run production workloads on the Free tier — one spike from another tenant can throttle your legitimate requests.

🧠 Architect’s Note

If you're hitting 429s consistently, the answer usually isn't more retries — it's caching. Most AI Search queries repeat frequently (same user queries, same autocomplete prefixes). Put a distributed cache in front of Search and your effective QPS multiplies without tier upgrades.

AI-Friendly Summary

Summary

Troubleshooting guide for the three most common Azure AI Search errors in .NET: HTTP 429 throttling, index-not-found errors, and field mapping mismatches during indexing. Provides root causes, code fixes, and prevention strategies for each.

Key Takeaways

  • 429 errors mean you've exceeded QPS limits for your Azure AI Search tier
  • Configure SearchClientOptions retry policy for automatic 429 handling
  • Index-not-found: verify index name, service endpoint, and creation timing
  • Field mapping errors: C# property names must match index field names (case-sensitive)
  • Use SearchIndexClient.GetIndexAsync() to validate index exists before querying

Implementation Checklist

  • Check Azure AI Search tier QPS limits against your request volume
  • Configure retry policies on SearchClientOptions
  • Verify index name matches exactly (case-sensitive)
  • Verify SearchClient points to correct Azure AI Search endpoint
  • Ensure C# model properties match index field definitions

Frequently Asked Questions

Why am I getting 429 errors from Azure AI Search?

Azure AI Search throttles requests when you exceed the queries-per-second (QPS) limit for your tier. The Free tier allows ~3 QPS, Basic allows ~15 QPS, and Standard tiers scale from 50+ QPS. The fix is either reducing request volume (batching, caching) or scaling up your service tier.

Can I retry 429 errors automatically?

Yes. The Azure.Search.Documents SDK has built-in retry with exponential backoff for transient errors including 429. You can configure retry options on SearchClientOptions. For bulk indexing, use IndexDocumentsAsync with batching to manage throughput.

What causes 'index not found' errors?

The index name in your code doesn't match what exists in Azure AI Search. Common causes: typo in the index name string, the index was deleted, you're pointing at the wrong Azure AI Search instance, or the index creation hasn't completed yet. Check the Azure Portal to verify the index exists.

You Might Also Enjoy

#Azure AI Search #Error Handling #.NET AI #Troubleshooting #Rate Limiting

Was this article useful?

Feedback is anonymous and helps us improve content quality.