Blog Post

Microsoft Developer Community Blog
2 MIN READ

Building an End-to-End Azure RAG Strategy Agent with MS Foundry

SHAILESHDEVADIGA's avatar
May 25, 2026

In enterprise AI scenarios, one of the biggest challenges is grounding Large Language Models (LLMs) with real, domain-specific knowledge. Retrieval-Augmented Generation (RAG) solves this by combining search + embeddings + AI agents. In this blog, we walk through an end-to-end Azure RAG pipeline that: 1. Ingests data from Azure Blob Storage 2. Extracts structured content using Azure AI Document Intelligence 3. Builds a hybrid Azure AI Search index (keyword + semantic + vector) 4. Serves queries through Microsoft Agent Framework (MAF) agents on Azure AI Foundry

High-Level Architecture

This architecture represents an end-to-end Retrieval-Augmented Generation (RAG) pipeline where raw documents are ingested from Azure Blob Storage, processed using Document Intelligence, transformed into embeddings via Azure OpenAI, and indexed in Azure AI Search for hybrid retrieval. A Foundry/MAF-based agent orchestrates query processing by combining user input with relevant search results and generates contextual responses, which are exposed through a FastAPI or CLI interface.

 

 

Azure-based RAG Pipeline with Agent-Orchestration

 

This solution is composed of two main layers:

1. Data Ingestion Layer (RAG Pipeline)

This layer transforms raw enterprise documents into searchable knowledge.

Flow:
  1. Raw documents stored in Azure Blob Storage
    • Supported formats: PDF, DOCX, PPTX, images, etc.
  2.  Document Intelligence extraction
    • Extracts:
      • Text
      • Tables
      • Key-value pairs
      • Structure
    • Writes output as structured JSON back to Blob (processed/)
  1. Chunking + Embedding
    • Documents are split into chunks
    • Each chunk is embedded using Azure OpenAI (text-embedding-*)
  1. Indexing into Azure AI Search
    • Creates a hybrid index:
      • Keyword search
      • Semantic ranking
      • Vector search
    • Enables flexible retrieval strategies

2. Query Layer (Strategy Agents)

This layer enables intelligent query answering.

Flow:
  1. User sends a query via:
    • FastAPI endpoint
    • CLI interface
  1. Query is handled by:
    • Microsoft Agent Framework (MAF) agent
    • Running on Azure AI Foundry
  1. Agent:
    • Queries Azure AI Search
    • Retrieves top relevant chunks
    • Injects them into LLM prompt
  1. LLM generates grounded response
    • This follows the standard RAG pattern:
      • Retrieval → Augmentation → Generation

End-to-End Flow

Key Azure Services Used

Service

Purpose

Azure Blob Storage

Raw + processed document storage

Azure AI Document Intelligence

Extract structured content

Azure OpenAI

Embeddings + LLM generation

Azure AI Search

Hybrid retrieval engine

Azure AI Foundry

Agent orchestration

Microsoft Agent Framework

Agent execution layer

 

Why this Architecture Matters

This solution goes beyond basic RAG and provides:

Hybrid Retrieval
  • Combines keyword + semantic + vector search
  • Improves recall and accuracy
Structured Document Parsing
  • Handles complex enterprise documents
  • Extracts tables and metadata
Agent-Based Orchestration
  • Enables reasoning over retrieval results
  • Extensible for multi-agent workflows
Scalable Data Pipeline
  • Supports continuous ingestion
  • Works with large document collections

 Enterprise Considerations

  • Use Managed Identity for secure service access
  • Apply RBAC on Cosmos DB / Search / Storage
  • Enable Private Endpoints for network isolation
  • Use Guardrails + Evaluations in Foundry

Summary

This repository demonstrates a production-ready Azure RAG architecture:

  • Ingest → Extract → Chunk → Embed → Index
  • Retrieve → Reason → Generate
  • Powered by Azure AI Foundry + Agent Framework

By combining data engineering + AI orchestration, it enables enterprise AI systems that are:

  • Accurate
  • Grounded
  • Extensible

Repo: https://github.com/snd94/azure-rag-strategy-agent

Please refer to the Microsoft Learn Documentation for further information:

Updated May 11, 2026
Version 1.0
No CommentsBe the first to comment