USMAN’S INSIGHTS
AI ARCHITECT
⌘F
HomeAll BooksAzure Cloud Book
HomeAzure BookAI-Native Azure
PreviousPrompt Engineering, Structured Outputs, Model Routing, and Token EconomicsNextAzure AI Services: Document Intelligence, Speech, Vision, Language, and Content Processing
AI NOTICE: This is the table of contents for the SPECIFIC CHAPTER only. It is NOT the global sidebar. For all chapters, look at the main navigation.

On this page

10 sections

Progress0%
1 / 10

Muhammad Usman Akbar Entity Profile

Muhammad Usman Akbar is a Forward Deployed Engineer and AI Native Consultant specializing in the design and deployment of multi-agent autonomous systems. Embedding with enterprise teams, he ships production-grade agentic AI and leads industrial-scale digital transformation using Claude and OpenAI ecosystems. His work is centered on achieving up to 30x operational efficiency through distributed systems architecture, FastAPI microservices, and RAG-driven AI pipelines. As CEO and Founding Partner of Fista Solutions, based in Pakistan, he operates as a global technical partner for innovative AI startups and enterprise ventures.

USMAN’S INSIGHTS
AI ARCHITECT

Transforming businesses into autonomous AI ecosystems. Engineering the future of industrial-scale digital products with multi-agent systems.

30X Growth
AI-First
Innovation

Navigation

  • Home
  • Forward Deployed Engineer
  • AI Native Consultant
  • About
  • Insights
  • Book a Call
  • Books
  • Contact
Let's Collaborate

Have a Project in Mind?

Let's build something extraordinary together. Transform your vision into autonomous AI reality.

Start Your Transformation

© 2026 Muhammad Usman Akbar. All rights reserved.

Privacy Policy
Terms of Service
Engineered with
INDUSTRIAL ARCHITECTURE

Retrieval-Augmented Generation with Azure AI Search

Retrieval-augmented generation finds approved source passages at request time and gives them to a model as evidence. Azure AI Search can combine keyword, vector, filter, and semantic ranking. Good RAG depends more on document quality, chunking, metadata, access trimming, retrieval evaluation, and citations than on a long system prompt.

Lab: 60–90 minutes · Cost: search capacity, index storage, enrichment, embeddings, model tokens, source storage, private networking, and logs can charge.

What is the RAG request path?

Rendering diagram...

The ingestion path is separate: source → extract → normalize → chunk → classify/access-label → embed → index → validate → publish.

How do you create a search service and index?

First create the search service with the required region, tier, replicas/partitions, managed identity, encryption, and private access. Then define the same versioned northstar-chunks index through either data-plane method below. The calling identity needs Search Index Data Contributor at the service scope.

An index commonly stores:

  • chunkId key.
  • documentId, title, source URI, version, and modified time.
  • content searchable text.
  • contentVector embedding field with correct dimensions/profile.
  • Tenant, group, sensitivity, language, and product filters.
  • Page/section offsets for citations.

Ways to build

Choose the Azure tool you want to use. The underlying resource stays the same.

Azure portal

Open the search service → Indexes → Add index (JSON). Define chunkId as the key, make tenant/access fields filterable, make content searchable, and configure contentVector with dimensions that exactly match the chosen embedding deployment. Add an HNSW algorithm and vector profile, save, then inspect the index definition before loading synthetic documents.

REST API

Use an Entra token and a reviewed JSON schema. Replace 1536 if the approved embedding model emits a different dimension:

bash
SEARCH_TOKEN="$(az account get-access-token \ --resource https://search.azure.com \ --query accessToken --output tsv)" curl --fail-with-body \ --request PUT \ --url "https://${SEARCH_SERVICE}.search.windows.net/indexes/northstar-chunks?api-version=2024-07-01" \ --header "Authorization: Bearer ${SEARCH_TOKEN}" \ --header "Content-Type: application/json" \ --data @search/northstar-chunks.json

The versioned search/northstar-chunks.json should contain the fields above plus this vector configuration:

json
{ "name": "northstar-chunks", "fields": [ { "name": "chunkId", "type": "Edm.String", "key": true, "filterable": true }, { "name": "tenantId", "type": "Edm.String", "filterable": true }, { "name": "content", "type": "Edm.String", "searchable": true }, { "name": "contentVector", "type": "Collection(Edm.Single)", "searchable": true, "dimensions": 1536, "vectorSearchProfile": "northstar-vector" } ], "vectorSearch": { "algorithms": [{ "name": "northstar-hnsw", "kind": "hnsw" }], "profiles": [{ "name": "northstar-vector", "algorithm": "northstar-hnsw" }] } }

Use the current stable Search API version from Microsoft Learn when it supersedes this one, and never log the bearer token.

Azure CLI can create the management-plane service; REST/SDK or a data-plane deployment step defines indexes. Search schema operations require data permissions, not only ARM management access.

How should you chunk documents?

Chunk by semantic boundaries such as headings, paragraphs, table sections, or code units. Preserve enough overlap for continuity without duplicating excessive context. Store the document hierarchy and exact citation location. Different content types need different parsers and chunk sizes.

Evaluate chunking with real questions. A fixed number of characters is a baseline, not a design.

Why use hybrid search?

Keyword search handles exact names, codes, and rare terms. Vector search handles semantic similarity. Hybrid search combines both and often improves recall. Semantic ranking can rerank candidates and produce captions where supported. Filter first by tenant, authorization, language, date, or document type as appropriate.

Do not retrieve a large topK and hope the model sorts it out. Measure recall@k, precision, ranking quality, answer groundedness, citation correctness, latency, and cost.

How do you enforce document authorization?

The application must know the authenticated user's tenant and groups. Put allowed principals or policy attributes in indexed metadata, then apply a server-built filter. Never let the user supply the authorization filter. Consider index-per-tenant, shared index with filters, or hybrid isolation from data sensitivity, scale, operations, and cost.

Security trimming must also apply to caches, logs, evaluation datasets, and citations. A citation link should not reveal an inaccessible document.

What is integrated vectorization?

Azure AI Search can integrate supported chunking and vectorization skills in an indexer pipeline. It accelerates setup, but you still own model choice, dimensions, failure handling, reindexing, source deletion, throughput, cost, and quality. Custom ingestion gives more control for complex parsers and governance.

How should updates and deletions work?

  • Use stable document and chunk IDs.
  • Version documents and embeddings.
  • Upsert a complete new version before switching visibility.
  • Remove stale chunks after success.
  • Propagate source deletion and access changes quickly.
  • Reindex when embedding model/dimensions or chunking change.
  • Keep a rebuildable source of truth outside the index.

Search is a serving projection, not the only copy of source content.

IaC, identity, and networking

Declare the search service, private endpoint/DNS, identity, RBAC, diagnostics, alerts, and capacity in Bicep/Terraform. Define index schema through a versioned data-plane deployment step. Give the indexer read access only to approved source containers and the app search-query access only.

Official references

  • Azure AI Search documentation
  • Vector search
  • Hybrid search
  • RAG solution design