How to Fix Azure AI Search: Setup, Indexing & Config Errors
Why This Is Happening
I've helped dozens of developers and IT teams get Azure AI Search working , and the same pattern shows up almost every time. The service itself isn't broken. The configuration is just wrong, or the wrong search mode was chosen for the job.
Azure AI Search is a fully managed, cloud-hosted retrieval service that connects your data to AI models and applications. It handles two very different workloads: classic search, which is a straightforward index-and-query model, and agentic retrieval, which is a multi-query pipeline built for LLM-assisted agent workflows. That distinction matters enormously. If you built your solution assuming both modes work the same way, you're going to hit walls fast.
Here are the most common reasons people land on this page:
- Indexer errors and stalled ingestion: Your indexer shows "Running" in the Azure portal but data never appears in the index. This is almost always a permissions issue between the search service and your data source, usually Azure Blob Storage or Cosmos DB.
- 403 Forbidden on API calls: You're hitting the REST endpoint but getting authentication failures. This happens when you mix up admin keys and query keys, or when Role-Based Access Control (RBAC) isn't wired correctly.
- Vector search returning garbage results: Your similarity search is returning documents that have nothing to do with the query. Typically this means your embedding dimensions don't match between index time and query time, or you're using a different embedding model for queries than you used for ingestion.
- Agentic retrieval failing in unsupported regions: This one trips people up constantly. Agentic retrieval is currently in public preview and only available in specific Azure regions. Classic search has no such restriction.
- Service provisioning errors: You tried to create a Free tier service but Azure says your subscription already has one. The Free tier allows exactly one search service per subscription, a limit that Microsoft doesn't surface clearly during the creation wizard.
- Throttling (HTTP 429): Search units are being exhausted, especially on Basic or Standard S1 tiers under high query loads. Queries start timing out or returning 429 errors without any obvious warning beforehand.
Microsoft's error messages here can be genuinely unhelpful. A 503 during indexer execution could mean half a dozen different things, resource contention, network timeouts, skill execution errors, and the portal often just says "transient error, retry." I know how frustrating that is when you're trying to ship a production feature.
The good news is that almost every common Azure AI Search problem has a definitive fix. Let's work through them. Browse all Microsoft fix guides →
The Quick Fix, Try This First
If your Azure AI Search service isn't working and you need a fast answer, start here. About 60% of issues I see in the wild come down to one of two things: the wrong API key being used, or the indexer not having the right identity permissions to read your data source.
Step 1, Confirm you're using the right key. In the Azure portal, navigate to your search service, then go to Settings > Keys. You'll see two keys: an Admin key and a Query key. The admin key has read and write access. The query key is read-only and cannot create or modify indexes. If your application is trying to write data or run indexers with a query key, every request will fail silently or return a 403.
Step 2, Check indexer status immediately. Go to your search service in the Azure portal, click Indexers in the left menu, select your indexer, and look at the Execution history tab. Expand the most recent run. You'll see a detailed breakdown of documents processed, failed, and skipped, plus any specific skill errors. This is almost always more informative than the top-level status message.
Step 3, Verify the search service identity has access to your data source. If you're pulling data from Azure Blob Storage, go to that storage account in the portal, click Access Control (IAM), then Role assignments. Your search service's managed identity needs at minimum the Storage Blob Data Reader role. If it's not listed there, that's your problem right there.
Step 4, Run a quick test query. In your search service, click Search explorer in the left nav. Select your index from the dropdown, leave the query as * (returns all documents), and hit Search. If you get results, your index is populated. If you get zero results with no error, the indexer ran but either found nothing to ingest or the content transformation failed silently.
Getting the service creation right from the start saves you from a cascade of downstream problems. Here's exactly how to do it.
In the Azure portal, click Create a resource, search for "Azure AI Search," and select it from the results. On the creation form, pay close attention to these fields:
Subscription and Resource Group: If you're in an organization with multiple subscriptions, confirm you're deploying to the right one. Search services cannot be moved between subscriptions after creation.
Service name: This becomes part of your endpoint URL (https://yourservicename.search.windows.net). Pick something meaningful, you can't rename it later.
Region: This is where people get burned. If you plan to use agentic retrieval (the LLM-assisted multi-query pipeline), you must choose a supported region right now. At the time of writing, agentic retrieval is in public preview with region restrictions. If you pick the wrong region and later try to enable agentic retrieval, you'll need to create a new service entirely. Classic search has no regional restrictions beyond normal Azure data residency requirements.
Pricing tier: The Free tier is fine for development but limits you to 50 MB of storage and 3 indexes. For anything production-bound, start at Basic or Standard S1. The Free tier also restricts you to one instance per subscription, if you already have one somewhere in your Azure account (perhaps from a tutorial months ago), service creation will fail with an error about tier limits.
After creation, enable the system-assigned managed identity immediately: go to Settings > Identity and toggle the status to On. Save. Then go assign that identity the appropriate roles on your data sources before doing anything else. You'll thank yourself later.
# Create a search service using Azure CLI
az search service create \
--name mysearchservice \
--resource-group myResourceGroup \
--sku standard \
--location eastus \
--identity-type SystemAssigned
If the command succeeds, you'll see the service provisioning state change to Succeeded within a few minutes. If it fails with QuotaExceeded, you've hit the per-subscription limit for that tier in that region.
This is the decision that most guides gloss over, and it's the one that causes the most rework. Let me give you the real-world breakdown.
Classic search is an index-first model. You define a schema, push or pull data into the index, and then your app sends a query and gets back ranked results in a single request-response cycle. No LLM is involved in the retrieval itself. It's predictable, low-latency, and cost-efficient. If you're building a product catalog search, a document search portal, or a support ticket lookup, classic search is what you want. It supports full-text, vector, hybrid, and multimodal queries. It's generally available and production-stable.
Agentic retrieval is built for a different scenario entirely. Instead of a single index, you define a knowledge base that can point at one or more knowledge sources. When a query comes in, an LLM assists with query planning, breaks the request into focused subqueries, runs them in parallel against the knowledge sources, reranks results semantically, and merges everything into a three-part response optimized for agent consumption. This is the right choice when you're grounding a chatbot or AI agent in proprietary enterprise data and you need it to handle complex, ambiguous, multi-part questions.
Here's the practical decision guide I use:
- Building a search bar on a website or app? → Classic search.
- Adding retrieval to an agent or chatbot? → Agentic retrieval, but only if your region supports it.
- Want multi-source retrieval without full LLM planning overhead? → Agentic retrieval with minimal reasoning effort setting.
- Need real-time data freshness (live content, not indexed snapshots)? → Agentic retrieval with remote knowledge sources, which bypass indexing and query live.
You can use both modes on the same search service, they share the underlying indexing and query engines. Agentic retrieval builds on top of classic search by adding the knowledge base context layer.
To set up a knowledge base for agentic retrieval in the portal, navigate to your search service, click Knowledge bases in the left menu (if you don't see it, your region doesn't support it yet), and click + Create. You'll define knowledge sources and optionally connect an Azure OpenAI or Microsoft Foundry model for LLM-assisted planning.
Indexing errors are the most common class of Azure AI Search problems I see. The indexer pulls data from your source, transforms it, and loads it into the search index. Each stage can fail independently.
Azure AI Search only indexes JSON documents. If your data source isn't natively JSON, the indexer serializes it, but that serialization can fail if the schema is unexpected. For supported data sources (Azure Blob Storage, Azure Cosmos DB, Azure SQL Database, SharePoint, OneLake), use the pull method: let the indexer handle serialization. For custom data or real-time sync requirements, you need the push method and must format your documents as JSON yourself before calling the indexer API.
Diagnosing a failed indexer run:
# Check indexer status via REST API
GET https://[servicename].search.windows.net/indexers/[indexername]/status?api-version=2024-07-01
api-key: [your-admin-key]
The response includes an executionHistory array. Look at the most recent entry. The errors and warnings arrays inside each execution are where your answers are. Common error codes you'll see:
ExtractionFailure, The indexer couldn't read or parse a document. Check file formats and encoding.SkillExecutionError, An AI enrichment skill (chunking, embedding, OCR) failed. Check skill configuration and connected resource quotas.MappingError, A field mapping between your data source and index schema is broken. A field in the source doesn't exist in the index schema or types don't match.TransientFailure, A temporary issue. Rerun the indexer once. If it fails again consistently, it's not transient.
To reset and manually rerun an indexer from the portal: go to Indexers, select yours, click Reset, then click Run. Alternatively via CLI:
az search indexer reset --name myindexer --service-name mysearchservice --resource-group myResourceGroup
az search indexer run --name myindexer --service-name mysearchservice --resource-group myResourceGroup
After the run completes, check Execution history again. A successful run shows documents processed count greater than zero, with zero errors. If you see documents skipped with no errors, your filter conditions or change detection policy may be excluding content.
Vector search is where I see the most subtle, hard-to-debug problems. The symptom is always the same: similarity search returns results that look completely unrelated. The cause is almost always a mismatch between how you generated embeddings at indexing time versus query time.
Here's the ironclad rule: use the same embedding model, the same vector dimensions, and the same normalization settings for both document ingestion and query vectorization. If you indexed documents using text-embedding-ada-002 (1,536 dimensions) and you're querying with text-embedding-3-small (also 1,536 dimensions by default but a completely different model), your results will be meaningless. The cosine similarity between embeddings from different models has no semantic meaning.
When configuring a vector index in the Azure portal, go to your search service, click Indexes, select your index, and click the Vector profiles tab. Confirm the algorithm configuration (HNSW or exhaustive KNN) and the dimensions match your embedding model. Any mismatch here and your vector queries silently return low-confidence results without throwing an error.
For AI enrichment, chunking, embedding generation, OCR on images, you define a skillset that runs during indexing. Common skillset errors:
# Check skillset execution errors in indexer status
GET https://[servicename].search.windows.net/indexers/[indexername]/status?api-version=2024-07-01
Look for SkillExecutionError in the errors array. This usually means one of:
- The Azure OpenAI resource you connected for embeddings has hit its token-per-minute quota. Go to that resource and check its metrics.
- The skill configuration references a deployment name that doesn't exist or was renamed.
- The chunking skill is producing chunks too large for the embedding model's context window (token limit exceeded).
For hybrid search (combining full-text and vector results), Azure AI Search handles the result fusion internally using Reciprocal Rank Fusion (RRF). You don't need to merge results yourself. Just make sure your index has both a searchable text field and a vector field, then issue a hybrid query that specifies both a search text parameter and a vectorQueries array.
Once data is in the index, the next set of problems is around querying. Let's go through the main ones.
HTTP 403 Forbidden: You're either using a query key for an operation that requires admin access, or your RBAC role assignments are wrong. In the portal go to your search service > Settings > Keys and verify which key you're using. If your app uses Microsoft Entra-based authentication (recommended for production), the calling identity needs either the Search Index Data Reader role (for queries) or Search Index Data Contributor (for write operations) at minimum. Assign these under Access Control (IAM) on the search service resource.
HTTP 429 Too Many Requests: You've exceeded your service's query capacity. Each search unit (SU) has throughput limits. Standard S1 starts at one replica, which handles approximately 15 queries per second (QPS). Scale up replicas to increase query throughput: go to Settings > Scale and add replicas. You can also add partitions to increase storage and indexing throughput.
Relevance tuning: If search results are returning in the wrong order, relevant documents buried below irrelevant ones, you have several tools. The Scoring profiles feature lets you boost certain fields (e.g., title matches count more than body matches). Go to your index definition, click Scoring profiles, and add field weights. For semantic reranking, enable the Semantic ranker on your index and add a queryType=semantic parameter to your queries. The semantic ranker uses Microsoft's language models to reorder results by meaning rather than just keyword frequency.
# Semantic search query example (REST)
POST https://[servicename].search.windows.net/indexes/[indexname]/docs/search?api-version=2024-07-01
Content-Type: application/json
api-key: [your-query-key]
{
"search": "how to reset password",
"queryType": "semantic",
"semanticConfiguration": "my-semantic-config",
"top": 5
}
If semantic ranker isn't available, confirm your service tier supports it. The Free tier does not include semantic ranking. It's available from Basic tier upward, but you need to enable it in the portal under Settings > Semantic ranker. After enabling, it may take a few minutes to propagate. If the query returns 400 Bad Request with a message about semantic configuration not found, you haven't created the semantic configuration inside your index definition yet, go to the index > Semantic configurations tab and create one.
Advanced Troubleshooting
If the step-by-step fixes above didn't resolve your issue, you're likely dealing with something at the network, identity, or enterprise policy level. Here's how to dig deeper.
Diagnostic logs and Azure Monitor: Azure AI Search integrates with Azure Monitor for detailed telemetry. In the portal, go to your search service > Monitoring > Diagnostic settings > + Add diagnostic setting. Enable the following log categories: OperationLogs, QueryLogs, and IndexingActivityLogs. Route them to a Log Analytics workspace. Once active (allow 5-10 minutes), you can query them in Log Analytics using KQL:
// Find all failed search operations in the last hour
AzureDiagnostics
| where ResourceType == "SEARCHSERVICES"
| where OperationName == "Query.Search"
| where ResultType == "Failed"
| project TimeGenerated, ResultSignature, DurationMs, properties_requestUri_s
| order by TimeGenerated desc
The ResultSignature column gives you the HTTP status code. The properties_requestUri_s column shows exactly what endpoint was called. This is far more informative than anything in the portal UI.
Private endpoints and network isolation: If your search service is configured with a private endpoint, all public network access is blocked. This means the Azure portal's Search Explorer will fail (it accesses the public endpoint), and any client outside the VNet will get connection refused errors rather than 401 or 403. Verify under Settings > Networking: if public network access is set to Disabled, your test clients must be on the same virtual network. For testing, temporarily set it to Enabled from selected IP addresses and whitelist your current IP.
Shared private links for indexer data access: If your data source (Blob Storage, Cosmos DB) is behind a private endpoint, your search service indexer can't reach it by default. You need to create a shared private link resource. In the portal go to your search service > Settings > Shared private access > + Add. Select the target resource and approve the connection on the data source side. This is an advanced feature that's only available on Basic tier and above.
RBAC vs. key-based authentication in enterprise environments: Microsoft recommends disabling key-based authentication in favor of Microsoft Entra ID for production workloads. If your organization has a policy enforcing this, your existing key-based code will break. To migrate: enable Role-based access control under Settings > Keys, assign appropriate roles to your application's service principal or managed identity, and update your code to use DefaultAzureCredential from the Azure SDK instead of hardcoded API keys. This transition requires rebuilding your authentication flow but is the right call for security compliance.
Indexer document-level access control: If you need different users to see different documents (common in enterprise scenarios), Azure AI Search supports security trimming via a security filter field in your index. Documents get a field (e.g., allowedGroups) that contains the group IDs permitted to see them. At query time, your app injects an $filter parameter based on the caller's group memberships. This is not automatic, you must build the group-to-document mapping into your indexing pipeline and implement the filter injection in your query layer.
InternalServerError codes that don't resolve after a reset and rerun, or if your search service endpoint becomes unreachable despite correct networking configuration, or if you're seeing data loss from an index corruption event, escalate immediately. These are platform-level issues that no amount of configuration changes on your end will fix. Go to the Azure portal, open a support request, and select severity A (production down) if your workload is customer-facing. You can also check the Azure status page at status.azure.com for any active incidents affecting the AI Search service in your region. For direct help, visit Microsoft Support.
Prevention & Best Practices
I've watched teams spend weeks firefighting Azure AI Search issues that were entirely preventable. Most of the pain comes from skipping the boring setup steps when you're excited to get querying. Don't do that. Here's how to build a search deployment that stays healthy.
Design your index schema before you write any data. Changing an index schema after you've indexed millions of documents means deleting the index and rebuilding from scratch. There's no ALTER TABLE in Azure AI Search. Define your fields, data types, filterable attributes, and vector configurations before you run a single indexer. Get sign-off from the people who will be writing queries, the field names and types they need must be in the schema from the start.
Use separate services for dev, staging, and production. The Free tier is great for prototyping. The moment you start thinking about production, spin up a separate service in its own resource group. Sharing a service between development and production means a bad indexer run in dev can consume compute that production queries need. Azure AI Search doesn't have a namespace or environment concept within a single service.
Monitor your search unit utilization proactively. Set up Azure Monitor alerts on the SearchLatencyMs and ThrottledSearchQueriesPercentage metrics. If throttling hits 5% of queries, add a replica before it hits 20%. Latency spikes are almost always a signal to scale horizontally (more replicas) rather than vertically (bigger SKU).
Store your index definition as code. Your index schema, indexer definition, skillset, and data source configuration should all be checked into version control as JSON files. This lets you recreate the entire setup in a new region in minutes rather than days of manual clicking. The Azure CLI and REST API both accept these JSON definitions directly.
Test your embedding pipeline end-to-end before loading production data. Ingest a small test set (50-100 documents), run a variety of vector and hybrid queries against it, and verify the semantic relevance of results before scaling up. Discovering that your embedding model was wrong after indexing a million documents is a very bad day.
- Enable diagnostic logging on day one, you'll need it the moment something breaks in production.
- Always use managed identity for data source access instead of connection strings with embedded keys.
- Set an indexer schedule (e.g., every 5 minutes) with a change detection policy so your index stays in sync without manual reruns.
- Enable the semantic ranker on your index from the start, reranking can be toggled on/off per query, so there's no cost unless you actually use it, but enabling it retroactively requires an index rebuild.
Frequently Asked Questions
How do I get started with Azure AI Search from scratch?
Start by creating a search service in the Azure portal, go to Create a resource > AI + Machine Learning > Azure AI Search, pick a region and pricing tier, and enable the system-assigned managed identity right after creation. Then assign that identity access to your data source (Blob Storage, Cosmos DB, etc.) via IAM role assignments. From there, create an index with your schema, create a data source connection, create an indexer to pull data in, and test queries via the Search Explorer in the portal. The whole path from zero to first query can take under two hours for a basic setup.
Why use Azure AI Search instead of just querying my database directly?
Your database is great at structured lookups, give me the row where ID equals 42. Azure AI Search is built for relevance-ranked information retrieval, which is a fundamentally different problem. It handles full-text search with tokenization, stemming, and language-specific analyzers, plus vector similarity search for semantic matching, all in a single query. On top of that, it handles AI enrichment during ingestion (chunking, embedding, OCR), semantic reranking of results, faceted navigation, and autocomplete, things that would take significant custom engineering to build on a database. For grounding AI agents and chatbots in enterprise data, it also integrates directly with Azure OpenAI and Microsoft Foundry through the agentic retrieval pipeline.
What is the difference between classic search and agentic retrieval in Azure AI Search?
Classic search is a direct index-query model: your app sends one request, gets back a ranked list of documents, done. It's fast, predictable, and has no LLM involved in retrieval. Agentic retrieval adds a knowledge base layer that uses an LLM to plan queries, break them into subqueries, run them in parallel across multiple knowledge sources, semantically rerank results, and synthesize a structured response optimized for agent workflows. Classic search is generally available; agentic retrieval is in public preview with region restrictions. Use classic search for most apps and websites, use agentic retrieval when you're grounding a chatbot or AI agent and need multi-source, LLM-assisted retrieval.
What is agentic retrieval and when should I actually use it?
Agentic retrieval is a multi-query pipeline designed for agent-to-agent workflows where a single user question might require pulling from several knowledge sources simultaneously. Instead of querying one index, you define a knowledge base, which can point to multiple knowledge sources, optionally including remote (live) content, and the service handles the orchestration automatically. You should use it when your AI agent needs to answer complex, multi-part questions by synthesizing information across several data domains, when you want LLM-assisted query decomposition without building that logic yourself, or when you need to mix indexed content with live remote content in the same retrieval step. For simple search-bar use cases, the overhead isn't worth it.
My Azure AI Search indexer keeps failing, how do I find the actual error?
Go to your search service in the Azure portal, click Indexers in the left navigation, select the failing indexer, and open the Execution history tab. Click the most recent run entry to expand it, the Errors and Warnings sections inside will show you document-level failure details including the exact error message and which document caused it. If the error says TransientFailure, try resetting and rerunning the indexer once. If you see AuthorizationFailure or ForbiddenError, your search service's managed identity doesn't have sufficient role permissions on the data source, go to the data source resource's IAM page and assign the correct role. For deeper diagnostics, enable IndexingActivityLogs in Azure Monitor diagnostic settings and query them in Log Analytics.
Can I do vector search and full-text search together in Azure AI Search?
Yes, this is called hybrid search and it's one of Azure AI Search's strongest features. Your index needs both a regular searchable text field and a vector field configured with the correct dimensions for your embedding model. At query time, you pass both a search text string and a vectorQueries array in the same request body. The service runs both searches independently and then fuses the result sets using Reciprocal Rank Fusion (RRF) to produce a single merged, relevance-ranked list. The benefit over pure vector or pure full-text search is that hybrid catches both exact keyword matches (which vectors sometimes miss) and semantic similarities (which keyword search misses entirely). You can further boost result quality by stacking the semantic ranker on top of hybrid results.