Ingest and Index Content for RAG
30-second answer
To ingest content for RAG, an Azure AI Search (Foundry IQ) indexer reads files from a data source such as Blob Storage, runs a skillset (OCR, Text Split, an embedding model) and writes one search document per chunk into an index. Scanned pages only become searchable when the OCR skill receives images (imageAction: generateNormalizedImages). Use a managed identity for access, a schedule to keep the index current, and reset the indexer when you change the pipeline. Audio and video are analysed first (for example with Content Understanding), then their text is indexed.
Simulate it » No Azure account neededExam objective: 5.1.1 Ingest and index content, such as documents, images, audio and video. 5.1.4 Configure RAG ingestion flow, including documents and OCR. (Skills measured as of April 16, 2026)
Simulations
Feel it before you read it. No account needed, nothing leaves this page.
Open your <strong>Azure AI Search</strong> service. (Microsoft now calls the service <strong>Foundry IQ</strong> in agent scenarios; the Azure resource is still a *Search service*.)
👆 Click the glowing item in the portal to continue
Read the steps as text
- Open your Azure AI Search service. (Microsoft now calls the service Foundry IQ in agent scenarios; the Azure resource is still a Search service.)
- Type srch-agt-kb01 in the search bar and pick srch-agt-kb01 under Services.
- On the Overview page select Import data (new).
- Point at the blob container with your files. Use the search service's managed identity so there are no keys to leak. It needs Storage Blob Data Reader on the account.
- Turn on Vectorize your text. The wizard adds Text Split (chunking) and an embedding skill, and adds a vectorizer to the index so queries are embedded for you.
- Switch on OCR so the scanned claim form and text inside diagrams become searchable. Image description and image vectors are optional extras that cost more.
- Enable the semantic ranker configuration now, and choose a schedule. A schedule keeps the index current as files change.
- The review shows the four objects the wizard builds: a data source, a skillset, an index and an indexer. Select Create.
- On Indexers you see each run: documents succeeded, documents failed and errors. Four files went in. Open a run to read warnings, such as a scanned page the pipeline couldn't read.
- Four files became seven documents: one per chunk. Each chunk is its own search document, so a citation can point at the exact passage.
🧪 Simulation for learning. Screens are simplified versions of the Azure portal; names, prices and IDs are examples. Nothing here touches real Azure.
🖱️ Drag to rotate · scroll or pinch to zoom
Ingest and index content
An indexer reads files from a data source, runs a skillset (OCR, Text Split, an embedding model) and writes one search document per chunk into the index. Scanned images only become searchable when the OCR skill gets the images (imageAction: generateNormalizedImages).
🤔 What happens if…
Read this tour as text
- Ingest and index content. An indexer reads files from a data source, runs a skillset (OCR, Text Split, an embedding model) and writes one search document per chunk into the index. Scanned images only become searchable when the OCR skill gets the images (imageAction: generateNormalizedImages).
- Keyword, vector, hybrid and semantic. Keyword search (BM25) matches words. Vector search compares embeddings, so it matches meaning. Hybrid runs both in parallel and merges them with Reciprocal Rank Fusion. The semantic ranker then re-reads the top 50 results with a language model and adds captions.
- Enrich with skills. A skillset is a chain of skills that adds fields to each document: built-in skills such as OCR, PII Detection and Key Phrase Extraction, a Web API custom skill for your own code, and the Content Understanding skill for layout-aware chunking. Outputs reach the index through output field mappings or index projections.
- Connect retrieval to an agent. A Foundry agent gets a knowledge base as a tool (an MCP endpoint). The project’s managed identity needs the Search Index Data Reader role. A retrieval reasoning effort of minimal, low or medium decides whether a model plans subqueries. Answers should come back with citations.
- Content Understanding analyzers. An analyzer turns a document into Markdown (layout, tables, figures) and into fields you define. Each field uses a method: extract (text on the page), classify (a fixed list) or generate (the model writes it). Fields come with a confidence score and a source location.
Contoso keeps its HR and finance policies as PDFs in Blob Storage, plus a scanned claim form. Build the four objects of an Azure AI Search pipeline with OCR, Text Split and an embedding model, notice what the first run misses, then fix it.
🎓 Education-only simulation. Your lab is saved in this browser, so you can leave and continue later.
😟 THE PROBLEM
Half the company PDFs are scans, so the search finds nothing in them, and re-indexing everything takes all night.
😊 THE SOLUTION
Run an indexer with a skillset: OCR for images, Text Split for chunks, an embedding model for vectors.
- Scanned pages with no searchable text✓ OCR skill with imageAction set to generateNormalizedImages
- A 200-page PDF is one giant result✓ Text Split chunks, one search document per chunk
- Full re-index on every change✓ Blob change detection and a schedule
Start with a question
Half of Contoso's policies are scanned PDFs. How do you make them searchable for an AI agent without retyping anything?
Think of a library that receives boxes of paper. Someone has to open each box, read what’s inside, split a long report into chapters, write a card for every chapter and put the cards in the catalogue. If a page is a photograph of text, somebody has to read the photo first.
In Azure AI Search that person is the indexer. The reading glasses are the OCR skill. The chapter splitting is Text Split. The catalogue is the index, and every chapter gets its own card, a chunk.
Explain it like I’m 10
The technical explanation
RAG (retrieval-augmented generation) only works as well as the index behind it. Azure AI Search (Microsoft calls it Foundry IQ when agents use it) builds that index with a pipeline of four objects.
The four objects
| Object | What it holds |
|---|---|
| Data source | Where the files are (a Blob Storage container, for example) and the identity used to read them. |
| Index | The fields: a key, a title, the chunk text, a text_vector field, and optional semantic settings. |
| Skillset | The enrichment steps: OCR, Text Split, an embedding skill, and any others you add. |
| Indexer | Runs the pipeline: crack the file, run the skills, map the output, write documents. |
You can create them in the portal with the Import data (new) wizard, with the Python SDK (azure-search-documents), or with the REST API.
From file to chunks
- Document cracking. The indexer opens PDFs, Office files and images and pulls out text, metadata and (if you ask) images.
- OCR. If
imageActionisgenerateNormalizedImages, the extracted images go to the OCR skill. A scanned page is only an image, so without this step it has no text at all. - Text Split. The text is cut into chunks (for example 2,000 characters with a 500 character overlap) so each passage stays focused.
- Embedding. The Azure OpenAI embedding skill calls your embedding deployment, such as
text-embedding-3-small, and returns a vector for each chunk. - Index projections. One search document per chunk, with a
parent_idthat points back to the file.
indexers.create_or_update_indexer(SearchIndexer(
name="ixr-policies", data_source_name="ds-policies",
target_index_name="policies-idx", skillset_name="ss-policies",
parameters=IndexingParameters(configuration={
"dataToExtract": "contentAndMetadata",
"imageAction": "generateNormalizedImages"}))) # without this, OCR sees nothing
This is integrated vectorization: chunking and embedding happen inside the pipeline, and a vectorizer on the index embeds the user’s question at query time with the same model. If you embed documents with one model and queries with another, the vectors don’t line up and results turn to noise.
Access without keys
Give the search service a system-assigned managed identity, then assign it Storage Blob Data Reader on the storage account. The data source then uses the identity instead of a connection string. If you forget the role, the indexer fails with a 403.
Keeping the index current
For blobs, change detection is built in: a scheduled run reads only new and changed files. Two cases need care:
- Deleted files. Turn on a deletion policy (such as soft delete) so removed blobs leave the index.
- Pipeline changes. If you change the skillset, chunk size or
imageAction, unchanged files are still skipped. Reset the indexer so every document is processed again. Enrichment caching stops you paying twice for skills whose input didn’t change.
What about images, audio and video?
| Content | How it gets in |
|---|---|
| PDFs and Office files | Document cracking, then Text Split and embeddings |
| Scanned pages and images | OCR skill with imageAction; optionally image description with a model or multimodal embeddings |
| Audio and video | Analyse first with Content Understanding (transcripts, segments, summaries) or Azure Speech, then index the text |
-
1 Crack
The indexer opens the file and extracts text and images.
-
2 Read
The OCR skill reads text from the images.
-
3 Split
Text Split cuts the content into chunks.
-
4 Embed
The embedding skill creates a vector for each chunk.
-
5 Project
Each chunk becomes a search document linked to its file.
Architect level Push or pull?
An indexer is the pull model: the service reads from a supported source on a schedule. The push model means your own code calls the index API to upload JSON documents, which is the only option for sources an indexer doesn’t support, and it gives you full control of timing.
Push has no skillset. If you need chunking or embeddings, you do them yourself before you upload, or you land the files in Blob Storage and use an indexer. Many teams do exactly that: a small job analyses audio or video, writes the Markdown transcript to Blob Storage, and the normal indexer picks it up.
Also check the limits of your tier: the number of indexes, indexers and skillsets, and the maximum time one indexer run can take, before you plan a very large first load.
Real-world business scenario
Contoso Insurance (fictional)
- The problem
- Claims handlers searched 30,000 policy PDFs and scanned forms by file name. A third of the files were scans, so full-text search never saw their content.
- What they used
- A blob container with every file, an Azure AI Search indexer that uses the service's managed identity, and a skillset with OCR, Text Split and the text-embedding-3-small skill. Index projections write one document per chunk, and the indexer runs nightly.
- Why that choice
- OCR makes scans searchable, chunks keep results precise and citeable, and change detection means only the files edited that day are read again.
- The result
- Handlers find the right clause in seconds, and the claims agent can cite the exact passage and file it used.
When to use it and when not to
✓ Use it when…
- You need an agent or app to answer from a large body of documents with citations.
- Your files include scans or images with text, and you want that text searchable.
- Content changes regularly and you want the index to follow it on a schedule.
✕ Think twice when…
- You only need to look up a few records by key. A database query is simpler.
- A file is uploaded by a user for this conversation only. File search on the agent fits better than a pipeline.
- You need typed fields from each document, such as invoice totals. Use Content Understanding for that.
↔ Alternatives to consider
- Push model with the SDK when the source has no indexer.
- Content Understanding to turn files into Markdown and fields before indexing.
- File search in the agent for one-off uploads.
Test yourself with exercises
5 original practice questions in the AI-103 style. Pick your answers, then check them. You will see why each option is right or wrong. Score 75% or more and this topic is marked complete.
Interview preparation
Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.
Beginner What does an indexer do in Azure AI Search?
Model answer
It pulls content from a data source, optionally enriches it with a skillset, and writes the result into a search index. You schedule it or run it on demand, and for blobs it only re-reads files that changed.
Intermediate Why are chunks stored as separate search documents in a RAG index?
Model answer
A model can only read a limited amount of context, and a whole 200-page PDF is a poor search result. Chunks are small enough to rank, embed and cite precisely, and the parent key links each one back to the file.
Interviewer follows up
How do you produce one search document per chunk?
You
Add a Text Split skill, then use an index projection in the skillset so each chunk is written as its own document with a parent_id.
Experienced developer Scanned PDFs in your container return no results. What do you check?
Model answer
Whether the skillset has an OCR skill and whether the indexer's imageAction is generateNormalizedImages. Without images the OCR skill has nothing to read. I'd also check the indexer's execution history for warnings, then reset and rerun after the fix.
Scenario You changed the chunk size in the Text Split skill, but the index still shows the old chunks. Why?
Model answer
The indexer remembers which blobs it has processed, so unchanged files are skipped. I'd reset the indexer so it reprocesses every document, or turn on enrichment caching to avoid paying again for skills whose inputs didn't change.
Architecture & design How would you design ingestion for 40,000 PDFs, scans and call recordings?
Model answer
Put PDFs and scans in Blob Storage and index them with a skillset that has OCR, Text Split and embeddings, using the search service's managed identity and a schedule. For recordings I'd analyse them with Content Understanding or Azure Speech first and index the transcripts, because indexers don't transcribe audio themselves.
Quick revision
Key points
- An indexer needs a data source and an index. A skillset is optional but is where OCR, chunking and embeddings happen.
- Chunk the text, then give each chunk its own search document with an index projection.
- OCR needs imageAction = generateNormalizedImages, otherwise scans yield no text.
- Use the search service's managed identity and Storage Blob Data Reader instead of connection strings.
- Blob change detection is automatic. Reset the indexer after changing the skillset or settings.
- Audio and video are analysed first (Content Understanding or Speech) and their text is indexed.
Important terminology
- Indexer
- A crawler in the search service that reads a data source, runs an optional skillset and writes documents into an index.
- Data source
- The connection to where the files live, such as an Azure Blob Storage container, with the identity used to read it.
- Skillset
- An ordered set of skills (OCR, Text Split, embeddings, PII detection and others) that enrich each document during indexing.
- Chunk
- A passage of a document, typically a few thousand characters with some overlap, that becomes its own search document.
- Index projection
- A skillset setting that writes one search document per chunk (child) and links each back to its source file (parent) with a key.
- imageAction
- An indexer setting that tells document cracking to extract images. generateNormalizedImages makes images available to the OCR skill.
- Integrated vectorization
- Chunking and embedding handled inside the indexer pipeline, with a vectorizer on the index that embeds queries at query time.
Common mistakes
- Forgetting imageAction, so scanned files are silently empty.
- Changing a skillset and expecting old documents to update without a reset.
- Embedding documents with one model and querying with another.
Exam tips
- "Scanned documents are not searchable" = OCR skill plus generateNormalizedImages.
- "One search result per passage" = Text Split plus index projections.
- "No keys in the pipeline" = managed identity on the search service with a data role.
Five quick revision questions
-
1.Which object ties a data source, a skillset and an index together?Show
The indexer.
-
2.Which indexer setting hands images to the OCR skill?Show
imageAction set to generateNormalizedImages.
-
3.What do you do after changing a skillset so old files are reprocessed?Show
Reset the indexer, then run it.
-
4.Which skill turns long text into passages?Show
The Text Split skill.
-
5.How do you make each chunk its own search document?Show
Use an index projection in the skillset.
Official references
Finished this lesson? Tick it off. Your progress is saved in this browser.
Next up: Semantic, Hybrid and Vector Search
Lesson done? Make it stick with a quick gameSort It, Match the Pairs, Lightning Round and Who Am I? Earn XP and badges.