AZ-204Chapter 21 of 102Objective 5.1

Azure AI Search (Cognitive Search)

This chapter covers Azure AI Search (formerly Cognitive Search), a cloud search-as-a-service solution that enables developers to build rich search experiences over heterogeneous content. For the AZ-204 exam, this topic appears in domain 'Integrate' under objective 5.1: 'Create an Azure Cognitive Search solution'. Expect roughly 5-10% of exam questions to touch on Azure AI Search concepts, including index creation, data sources, skillsets, indexers, and querying. Mastering this chapter will prepare you to design and implement search solutions that leverage AI enrichment, knowledge stores, and semantic search.

25 min read
Intermediate
Updated May 31, 2026

Azure AI Search as a Library Catalog System

Think of Azure AI Search as a modern library catalog system for a massive digital library. The library has millions of books (documents), each with various attributes like title, author, subject, and publication year. A traditional catalog allows you to search by exact title or author, but it cannot understand the content or meaning of the books. Azure AI Search, however, is like a catalog that not only indexes all metadata but also reads every book, extracts key concepts, identifies named entities (people, places, dates), translates languages, and even generates summaries. When a patron searches for 'books about space exploration in the 1960s', the catalog doesn't just match keywords; it understands the query's intent, uses synonyms, applies language analysis, ranks results by relevance using a scoring profile, and returns the most pertinent books with highlighted excerpts. The catalog can also suggest 'Did you mean?' corrections, filter by subject, and sort by relevance or date. Importantly, the catalog is built once and then queried many times—just like Azure AI Search, where an index is created and populated, then queried via REST or SDK. The AI enrichment pipelines are like specialized librarians who add value: they perform OCR on scanned pages, extract key phrases, and even detect sentiment. All these enrichments are stored in a knowledge store (like a reference desk) for further analysis. The entire system is designed for fast, relevant search at scale, handling thousands of queries per second.

How It Actually Works

What is Azure AI Search?

Azure AI Search is a managed cloud service that provides full-text search over indexed content, with optional AI enrichment to extract insights from unstructured data. It is part of the Azure AI portfolio and is used to build search experiences for web and mobile applications, enterprise content management, and e-commerce.

Why it exists

Traditional databases struggle with full-text search at scale—they lack ranking, typo tolerance, and natural language support. Azure AI Search provides: - Full-text search with Lucene-based query engine - AI enrichment via Cognitive Services (e.g., OCR, entity recognition, key phrase extraction) - Knowledge store to persist enriched data for downstream analytics - Semantic search for better understanding of query intent - Scalability up to billions of documents

How it works internally

The core components are: - Index: a collection of documents and their fields, with a schema defining field types (Edm.String, Edm.Int32, etc.) and attributes (searchable, filterable, facetable, sortable). - Data source: a connection to data in Azure Blob Storage, Cosmos DB, SQL Database, or other sources. - Skillset: a set of AI skills (e.g., OCR, language detection) that transform and enrich data during indexing. - Indexer: a pipeline that connects data source to index, optionally applying a skillset. - Query: a request to the search endpoint using REST or SDK, returning ranked results.

Index creation and schema

An index is defined by a JSON schema. Example:

{
  "name": "hotels",
  "fields": [
    {"name": "HotelId", "type": "Edm.String", "key": true, "searchable": false, "filterable": true},
    {"name": "HotelName", "type": "Edm.String", "searchable": true, "filterable": true, "sortable": true},
    {"name": "Description", "type": "Edm.String", "searchable": true, "analyzer": "en.microsoft"},
    {"name": "Rating", "type": "Edm.Double", "filterable": true, "sortable": true, "facetable": true}
  ]
}

Key: each index must have one field marked as key (unique identifier).

Analyzers: language-specific analyzers (e.g., en.microsoft, fr.microsoft) handle stemming, stop words, and tokenization.

Default analyzer: for searchable fields, the default is the Lucene standard analyzer.

Data sources and indexers

Data sources define where data comes from. Supported types:

Azure Blob Storage

Azure Cosmos DB (SQL API, MongoDB API, Gremlin API)

Azure SQL Database / SQL Managed Instance

Azure Table Storage

Azure Data Lake Storage Gen2

SharePoint Online (preview)

Azure Files

An indexer runs on a schedule or on-demand, pulling data from the data source, optionally applying a skillset, and writing to the index. Indexers track changes using high-water mark or change tracking.

AI enrichment with Skillsets

Skillsets are a sequence of cognitive skills. Built-in skills include: - OCR: extracts text from images (JPEG, PNG, BMP, TIFF) - Language detection: detects language of text - Entity recognition: extracts entities like people, organizations, locations - Key phrase extraction: identifies key phrases - Sentiment analysis: determines sentiment score (positive/negative/neutral) - PII detection: detects personally identifiable information - Image analysis: describes images, generates tags - Custom skill: allows calling a custom API (e.g., Azure Function) for specialized processing

Skills are defined in a skillset JSON. Each skill has inputs and outputs that map to fields in the index. Example OCR skill:

{
  "@odata.type": "#Microsoft.Skills.Vision.OcrSkill",
  "context": "/document",
  "defaultLanguageCode": "en",
  "inputs": [
    {"name": "image", "source": "/document/normalized_images/*"}
  ],
  "outputs": [
    {"name": "text", "targetName": "extractedText"}
  ]
}

Knowledge Store

The knowledge store is a feature that persists enriched data to Azure Storage (Blob, Table, or Azure SQL) for analysis or reuse. It is defined as a projection in the skillset. Example:

"knowledgeStore": {
  "storageConnectionString": "DefaultEndpointsProtocol=https;AccountName=...;AccountKey=...",
  "projections": [
    {
      "tables": [],
      "objects": [
        {
          "storageContainer": "enricheddata",
          "source": "/document"
        }
      ],
      "files": []
    }
  ]
}

Querying the index

Queries are sent via REST or SDK. Example REST query:

POST /indexes/hotels/docs/search?api-version=2023-10-01-Preview
{
  "search": "luxury hotel",
  "searchMode": "any",
  "filter": "Rating gt 4",
  "orderby": "Rating desc",
  "select": "HotelName, Description, Rating",
  "top": 10
}

searchMode: 'any' (OR) or 'all' (AND).

filter: OData filter expressions for pre-query filtering.

facet: enables faceted navigation (e.g., by category).

scoringProfile: custom scoring to boost certain fields.

semantic: enable semantic search for better relevance.

Semantic Search

Semantic search uses AI to understand query intent. It returns: - Semantic caption: a short, relevant excerpt - Semantic answers: direct answers to questions (e.g., "What is the capital of France?")

Enabled by setting queryType: 'semantic' and semanticConfiguration in the index.

Performance and scaling

Service tiers: Free (shared, limited to 50 MB storage, 3 indexes), Basic (2 replicas, 1 partition), Standard (S1, S2, S3) with varying partitions and replicas.

Replicas: handle query load; increase for higher QPS.

Partitions: distribute index data; increase for larger datasets.

Queries per second (QPS): S1 can handle ~15 QPS per replica; S2 ~60 QPS; S3 ~200 QPS (approximate).

Security

Authentication: API keys (admin and query keys) or Azure AD authentication (preview).

Network: Azure Private Link for private endpoint access.

Data at rest: encrypted by default with Microsoft-managed keys; customer-managed keys (CMK) supported.

Data in transit: HTTPS enforced.

Integration with other Azure services

Azure Cognitive Services: used for AI enrichment (e.g., Computer Vision, Text Analytics).

Azure Storage: knowledge store, data source.

Azure Functions: custom skills.

Azure Logic Apps / Power Automate: automate indexing workflows.

Azure Synapse Analytics: query knowledge store via Synapse.

Common configurations and defaults

Indexer execution history: retained for 30 days.

Maximum index size by tier: Free 50 MB, Basic 2 GB, S1 25 GB, S2 100 GB, S3 200 GB.

Maximum fields per index: 1000.

Maximum skills per skillset: 30.

Indexing frequency: can be set to run every 5 minutes (minimum) or on-demand.

Verification commands

Using Azure CLI:

# Create a search service
az search service create --name mysearch --resource-group myrg --sku basic

# List admin keys
az search admin-key show --service-name mysearch --resource-group myrg

# Create an index
az search index create --service-name mysearch --name hotels --fields @index.json

Using Azure PowerShell:

New-AzSearchService -Name mysearch -ResourceGroupName myrg -Sku Basic
Get-AzSearchAdminKey -ServiceName mysearch -ResourceGroupName myrg

How it interacts with related technologies

Azure AI Search is often used alongside Azure Bot Service to enable search in chatbots.

Azure Cognitive Services provide the AI skills; Azure AI Search orchestrates them.

Azure Data Lake can be a data source for large-scale indexing.

Azure API Management can expose search endpoints with rate limiting and security.

Exam-critical details

The indexer is the key component that automates data ingestion.

Skillsets are optional; without them, the indexer just copies data verbatim.

Knowledge store is separate from the index; it stores enriched data.

Semantic search requires a semantic configuration defined in the index.

Custom skills must be implemented as an Azure Function or web API.

Free tier is limited and cannot be scaled; only one shared partition.

Indexer execution can be triggered manually or on a schedule; the schedule uses cron expressions.

Change detection for data sources: Azure Blob uses last modified timestamp; SQL uses change tracking or high-water mark.

Query expansion with synonyms: define a synonym map and attach to index.

Scoring profiles allow boosting results based on field values or freshness.

CORS support for cross-origin requests from browsers (e.g., for JavaScript clients).

Walk-Through

1

Create Azure AI Search service

Provision an Azure AI Search resource via Azure portal, CLI, or ARM template. Choose a tier: Free (shared, limited), Basic (1 partition, 2 replicas), or Standard (S1, S2, S3) with varying storage and throughput. The service endpoint is like https://mysearch.search.windows.net. Obtain admin API keys for management and query keys for read-only access.

2

Define data source

Create a data source object that points to the location of your data. Supported types include Azure Blob Storage, Azure SQL Database, Cosmos DB, etc. Provide connection string and container/table name. For change tracking, enable appropriate settings: for Blob, use last modified; for SQL, use SQL change tracking or a high-water mark column.

3

Design index schema

Define the index schema in JSON: specify field names, types (Edm.String, Edm.Int32, etc.), and attributes (searchable, filterable, sortable, facetable). Mark one field as key (unique identifier). Optionally assign analyzers (e.g., en.microsoft for English). For semantic search, add a semantic configuration that defines title, content, and keyword fields.

4

Create skillset (optional)

If AI enrichment is desired, define a skillset JSON with an ordered list of skills. Each skill has inputs from a context path (e.g., /document) and outputs to target fields. Skills can include OCR, entity recognition, key phrase extraction, etc. Map outputs to fields in the index. Optionally define a knowledge store projection to persist enriched data.

5

Create and run indexer

Create an indexer that connects the data source, index, and skillset. The indexer pulls data, applies skills, and writes to the index. You can run it once or set a schedule (e.g., every 5 minutes). Monitor execution status via portal or REST API. Check for errors in the execution history (retained 30 days).

6

Query the index

Use REST API or SDK to send search queries. Construct a JSON payload with search text, filters, facets, ordering, and pagination (top, skip). Use searchMode 'any' or 'all'. For semantic search, set queryType to 'semantic'. Parse response: value array contains results, @search.score for relevance, @search.caption for semantic captions, @search.answers for direct answers.

What This Looks Like on the Job

Enterprise Scenario 1: E-commerce Product Search

A large online retailer uses Azure AI Search to power product search on their website. They index millions of products from a Cosmos DB database. The index includes fields like product name, description, category, price, and reviews. They use a skillset with entity recognition to extract brand names and key phrase extraction to generate tags. A knowledge store persists enriched data to Blob Storage for analytics. The search service is scaled to S3 with 12 replicas to handle 10,000 QPS during peak sales. Common issues: indexer failures due to schema mismatches (e.g., a field expected as Edm.Double receives a string) or throttling from Cognitive Services API rate limits. They mitigate by using batch size and retry policies.

Enterprise Scenario 2: Healthcare Document Search

A healthcare organization indexes medical records stored as PDFs in Azure Blob Storage. They use OCR skill to extract text from scanned documents, language detection to identify documents in multiple languages, and PII detection to redact patient information. The index allows doctors to search for diagnoses, medications, and procedures. They use semantic search to provide direct answers to queries like 'What is the dosage of aspirin?'. The knowledge store stores enriched JSON for compliance audits. Misconfiguration: forgetting to set the OCR skill's 'defaultLanguageCode' leads to poor text extraction for non-English documents.

Enterprise Scenario 3: Legal Document Review

A law firm indexes millions of legal documents from a SharePoint Online site. They use custom skills to call an Azure Function that performs custom legal entity extraction (e.g., case numbers, court names). The index is used by paralegals to find relevant cases. They use facets for document type and date. They set up a schedule indexer to run nightly. Performance consideration: indexing large documents with many images can be slow; they use the 'imageAction' parameter to generate normalized images. Common problem: indexer fails because the SharePoint data source requires a valid connection string with OAuth; they use managed identity for authentication.

How AZ-204 Actually Tests This

The AZ-204 exam tests objective 5.1: 'Create an Azure Cognitive Search solution'. Expect questions on:

1.

Index creation and field attributes: Know the difference between searchable, filterable, sortable, and facetable. Trap: candidates confuse 'filterable' with 'searchable'. Fact: a field must be searchable to be used in full-text search; filterable is for exact matches. Wrong answer: 'A field must be filterable to be used in search queries' – actually, search queries use searchable fields.

2.

Indexer vs. skillset: Candidates often think skillsets are required for indexing. Reality: skillsets are optional; an indexer can copy data directly without enrichment. Trap: 'An indexer must have a skillset' – false.

3.

Knowledge store purpose: Many think the knowledge store is the same as the index. Reality: the knowledge store persists enriched data to Azure Storage for separate analysis; the index is for search. Trap: 'The knowledge store is used for search queries' – incorrect; queries use the index.

4.

Semantic search requirements: Semantic search requires a semantic configuration in the index. Trap: 'Semantic search works without any configuration' – false; you must define which fields are title, content, and keywords.

5.

Custom skills: Must be implemented as an Azure Function or web API. Trap: 'Custom skills can be any HTTP endpoint' – partially true, but must be accessible from the search service and return expected JSON.

6.

Tier limitations: Free tier has 50 MB storage and 3 indexes. Trap: 'Free tier can be scaled' – false; it's shared capacity with no scaling.

7.

Change tracking: For SQL, use high-water mark or SQL change tracking. For Blob, use last modified. Trap: 'All data sources support the same change tracking' – false.

8.

Scoring profiles: Used to boost results based on field values or recency. Trap: 'Scoring profiles are mandatory' – false; default scoring uses TF-IDF.

9.

Synonyms: Define a synonym map and attach to index. Trap: 'Synonyms are defined inline in the query' – false; they are defined at the index level.

10.

Security: Use API keys (admin and query). Trap: 'Query keys can create indexes' – false; query keys are read-only.

Edge cases: Indexer execution history is retained for 30 days; maximum fields per index is 1000; maximum skills per skillset is 30. The exam loves to test these limits.

Eliminate wrong answers by understanding the underlying mechanism: if a question asks about storing enriched data for analytics, the answer is knowledge store, not index. If it asks about improving search relevance, consider scoring profiles or semantic search. Always check if the scenario requires AI enrichment – if not, skillset is unnecessary.

Key Takeaways

Azure AI Search is a managed search service that indexes content and provides full-text search with optional AI enrichment.

An indexer connects a data source to an index, optionally applying a skillset for AI enrichment.

Skillsets are optional; without them, indexing is a direct copy of data.

The knowledge store persists enriched data to Azure Storage for analytics, separate from the search index.

Semantic search requires a semantic configuration in the index and uses queryType 'semantic'.

Custom skills must be implemented as an Azure Function or web API with a specific JSON response schema.

Free tier is for development only; production requires Basic or Standard tier with appropriate replicas and partitions.

Indexer execution history is retained for 30 days; maximum fields per index is 1000.

Change tracking for data sources: Blob uses last modified; SQL uses high-water mark or change tracking.

Security uses admin and query API keys; Azure AD authentication is in preview.

Easy to Mix Up

These come up on the exam all the time. Here's how to tell them apart.

Azure AI Search

Purpose-built for search at scale with distributed index

Supports AI enrichment via skillsets (OCR, entity recognition, etc.)

Provides faceted navigation, scoring profiles, and semantic search

Indexes from heterogeneous data sources (Blob, Cosmos DB, SQL, etc.)

Scales horizontally with partitions and replicas

Azure SQL Database Full-Text Search

Full-text search feature within a relational database

No built-in AI enrichment; relies on T-SQL functions

Limited faceting and scoring; no semantic search

Only indexes data within the same SQL database

Scales vertically with database tier; limited search performance

Watch Out for These

Mistake

Azure AI Search requires AI enrichment (skillset) to index data.

Correct

Skillsets are optional. An indexer can index data directly without any AI skills, simply copying fields from the data source to the index.

Mistake

The knowledge store is the same as the search index.

Correct

The knowledge store is a separate persistence of enriched data in Azure Storage (Blobs, Tables, SQL) for downstream analytics, not for search queries.

Mistake

Semantic search works automatically without configuration.

Correct

Semantic search requires a semantic configuration in the index that defines which fields are title, content, and keywords. Without it, semantic queries fail.

Mistake

You can use any HTTP endpoint as a custom skill.

Correct

Custom skills must be an Azure Function or a web API that returns a specific JSON schema. The endpoint must be accessible from the search service and respond within a timeout.

Mistake

The Free tier of Azure AI Search is suitable for production workloads.

Correct

Free tier is shared, limited to 50 MB storage and 3 indexes, with no SLA. It is for development and testing only. Production requires at least Basic or Standard tier.

Do You Actually Know This?

Reveal each answer, then mark whether you got it right. Score 60%+ to unlock the next chapter.

Frequently Asked Questions

What is the difference between an indexer and a skillset in Azure AI Search?

An indexer is a pipeline that connects a data source to an index, pulling data and optionally applying a skillset. A skillset is a collection of AI skills that enrich the data during indexing (e.g., OCR, entity extraction). Without a skillset, the indexer just copies data verbatim. Think of the indexer as the conveyor belt and the skillset as the processing stations along the belt.

Can I use Azure AI Search without any AI enrichment?

Yes, absolutely. AI enrichment via skillsets is optional. You can create an indexer that simply copies fields from your data source (e.g., Azure Blob Storage) directly into the search index. This is common for scenarios where the data is already structured and you only need full-text search.

What is the knowledge store and when should I use it?

The knowledge store is a feature that persists enriched data from a skillset to Azure Storage (Blob, Table, or SQL). It is used for downstream analytics, machine learning, or compliance. Use it when you need to retain the enriched data beyond the search index, for example, to analyze extracted entities or generate reports.

How do I enable semantic search in Azure AI Search?

First, define a semantic configuration in your index schema that specifies which fields are title, content, and keywords. Then, when querying, set the queryType parameter to 'semantic' and include the semanticConfiguration name. The response will include semantic captions and optionally semantic answers.

What are the limits of the Free tier of Azure AI Search?

The Free tier is limited to 50 MB of storage, 3 indexes, and 10,000 documents. It runs on shared resources with other tenants and has no SLA. You cannot scale it; it is intended for development, testing, and small proof-of-concepts only.

Can I use Azure AD authentication with Azure AI Search?

Yes, Azure AD authentication is supported in preview. You can assign roles (e.g., Search Service Contributor, Search Index Data Reader) to users or service principals. This allows you to use managed identities for indexers and avoid API keys.

How do I handle large documents with OCR in Azure AI Search?

For large documents, use the 'imageAction' parameter in the indexer configuration to generate normalized images. Set 'generateNormalizedImagePerPage' to true. Also, consider splitting large PDFs into pages using the 'dataToExtract' parameter set to 'contentAndMetadata' or 'allMetadata'. Monitor the Cognitive Services API rate limits and batch requests accordingly.

Terms Worth Knowing

Ready to put this to the test?

You've just covered Azure AI Search (Cognitive Search) — now see how well it sticks with free AZ-204 practice questions. Full explanations included, no account needed.

Done with this chapter?