End-to-End Azure AI Foundry And Agents Development Laboratory
Master Azure AI Foundry and Agents through hands-on experimentation and real-world applications
π― Getting Started β’ π Learning Path β’ π§ Setup Guide β’ π οΈ Troubleshooting
This comprehensive laboratory transforms you from an AI enthusiast into an Azure AI Foundry expert. Through progressive, hands-on modules, you'll master:
- Setup, Authentication, Quick Start
- Prompting, Embeddings, RAG
- Agents β File Search, Bing, Azure Functions, Multi-Agent
- Model Context Protocol (MCP) with Agents
- AI Red Teaming & Security Testing
- Agent Framework β Advanced Agent Development
- Observability & Evaluation
- AI Language Services with Low-Code Workflows
- AI Vision with Low-Code Solutions
- Content Understanding & Document Classification
- Responsible AI & Content Safety
π Laboratory Format: One day intensive hands-on experience
π― Target Audience: Developers, AI practitioners, and solution architects
π‘ Learning Approach: Progressive complexity with real-world applications
agentic-ai-lab/
βββ π 1. initial-setup/ # Start here - Authentication & environment setup
βββ π¬ 2. chat-rag/ # Chat completion and RAG fundamentals
βββ π€ 3. agents/ # AI Agents development and tools (includes multi-agent)
βββ π 4. agents-with-mcp/ # Model Context Protocol (MCP) integration
βββ π΄ 5. ai-red-teaming-agent/ # AI Red Teaming and Security Testing
βββ π€βοΈ 6. agent-framework/ # Microsoft Agent Framework for advanced agent development
βββ π 7. observability-and-evaluations/ # Monitoring, evaluation, and quality assurance
βββ π£οΈ 8. ai-language/ # AI Language Services with Logic Apps low-code workflows
βββ ποΈ 9. ai-vision/ # AI Vision Services with low-code solutions
βββ π 10. content-understanding/ # Document classification and content extraction
βββ π‘οΈ 11. responsible-ai/ # Responsible AI, Content Safety, and PII Detection
# Clone the laboratory repository
git clone https://github.com/microsoft/agentic-ai-lab-dotnet.git
cd agentic-ai-lab
# Verify Python version
dotnet --version # Should be 10.0.0 or higher-
Create Azure AI Foundry Resource and Project
To create an AI Foundry resource in the Azure portal follow these instructions:
-
Select this AI Foundry resource link: https://portal.azure.com/#create/Microsoft.CognitiveServicesAIFoundry
-
On the Create page, provide the following information:
Project details Description Subscription Select one of your available Azure subscriptions. Resource group The Azure resource group that will contain your Azure AI Foundry resource. You can create a new group or add it to a preexisting group. Region The location of your Azure AI service instance. Different locations may introduce latency, but have no impact on the runtime availability of your resource. Name A descriptive name for your Azure AI Foundry resource. For example, MyAIServicesResource. Default Project Name Keep the default project as it is. - Keep other settings for your resource as default, read and accept the conditions (as applicable), and then select Review + create.
-
-
Deploy Required Models & Services
Model Type Recommended Models Purpose Chat/Completion gpt-4o,gpt-4o-miniPrimary reasoning & conversation Text Embeddings text-embedding-3-largeVector search & RAG -
Configure an Azure Search Service
-
Configure Grounding with Bing Search
- Create a new Grounding with Bing Search resource in Azure
- Connect this resource to your AI Foundry project
- Navigate to your AI Foundry project β Management Center β Connected Resources β Add Connection β Select Grounding with Bing Search
-
Create Content Understanding Resource
- Create an Azure AI Content Understanding multi-service resource following the official documentation
- Ensure the resource is created in a supported region (westus, swedencentral, australiaeast)
-
Configure Environment Variables
- Copy
.env.exampleto.envin the root directory and update values accordingly - This repository expects the
.envfile to be in the root directory, if you want to store it elsewhere or name it something else, update theload_dotenv()calls in notebooks - Many of the Environment Variables needed can be found in the Overview tab of your Azure AI Foundry project or the connected resources in the Management Center tab
- For example, AZURE_OPENAI variables-
- Copy
Follow this structured learning path to master Azure AI Foundry:
Location: 1. initial-setup/
| Notebook | Description |
|---|---|
| π Quick Start | First AI model interaction |
Location: 2. chat-rag/
| Notebook | Description |
|---|---|
| π¬ Basic Chat Completion | Foundation models and prompting |
| π Embeddings | Vector representations and similarity |
| π Basic RAG | Retrieval-Augmented Generation |
Location: 3. agents/
| Notebook | Description |
|---|---|
| π€ Agent Basics | Fundamental agent concepts |
| π» Code Interpreter | Code execution capabilities |
| π File Search | Document processing |
| π Bing Grounding | Web search integration |
| π Agents + AI Search | Enterprise search integration |
| β‘ Agents + Azure Functions | Serverless integration |
| π₯ Multi-Agent Solution | Collaborative AI systems |
Location: 4. agents-with-mcp/
| Implementation | Description |
|---|---|
| π MCP Inventory Agent | Complete working implementation of agents that connect to MCP servers for dynamic tool discovery. Features an intelligent inventory management agent for a cosmetics retailer with automated restock and clearance recommendations. Includes both client and server implementations with interactive chat interface. |
Location: 5. ai-red-teaming-agent/
| Implementation | Description |
|---|---|
| π΄ AI Red Teaming Agent | Advanced AI security testing and vulnerability assessment using red teaming methodologies. Features automated adversarial prompt generation, safety evaluation, and comprehensive security analysis of AI systems. |
Location: 6. agent-framework/
The Microsoft Agent Framework is an open-source development kit that unifies and extends Semantic Kernel and AutoGen into the next-generation foundation for AI agent development. Built by the same teams, it offers two primary capabilities: AI Agents for autonomous decision-making with tool integration and conversation management, and Workflows for orchestrating complex multi-agent processes with type safety and checkpointing. Currently in public preview, it combines AutoGen's simple abstractions with Semantic Kernel's enterprise features while adding robust workflow capabilities.
π Official Documentation β’ π GitHub Repository β’ π Complete Guide
| Notebook | Description |
|---|---|
| π€ Basic Agent Usage | Fundamental agent concepts with automatic lifecycle management |
| βοΈ Explicit Settings | Agent creation with explicit configuration patterns |
| π Existing Agent Management | Working with pre-existing agents using agent IDs |
| π¬ Thread Management | Conversation thread continuity and management |
| π§ Function Tools | Comprehensive function tool integration patterns |
| π» Code Interpreter | Python code execution and mathematical problem solving |
| π File Search | Document-based question answering with file uploads |
| π Bing Grounding | Web search integration using Bing Grounding |
| Implementation | Description |
|---|---|
| π Azure AI with MCP | Hosted MCP tools with Azure AI Foundry agents (basic, multi-tool, thread-based examples) |
| π₯οΈ Agent as MCP Server | Expose Agent Framework agents as MCP servers |
| π MCP API Key Auth | API key authentication patterns for MCP servers |
| Category | Description |
|---|---|
| π Start Here | Foundational workflow concepts, executors, edges, agents, streaming |
| π― Orchestration | Sequential and concurrent agent coordination patterns |
| πΎ Checkpointing | State persistence for long-running workflows |
| π€ Human-in-the-Loop | Interactive approval and feedback patterns |
| π§ Magentic | AI-driven multi-agent planning and execution |
| Notebook | Description |
|---|---|
| π§ Agent & Run Level | Middleware fundamentals and scoping |
| π¨ Function-Based | Function-based middleware patterns |
| ποΈ Class-Based | Class-based middleware with inheritance |
| π¨ Decorator Middleware | @agent_middleware and @function_middleware decorators |
| π¬ Chat Middleware | Message interception and modification |
| Error handling and recovery patterns | |
| π Termination | Early termination and control flow |
| π Result Override | Streaming and non-streaming result modification |
| π¦ Shared State | State management with middleware containers |
| Notebook | Description |
|---|---|
| πΎ Azure AI Memory | Agent memory with user fact extraction, tone detection, and persistent context |
| Notebook | Status | Description |
|---|---|---|
| π¬ Azure AI Thread Serialization | β | Service-managed threads with cloud storage (~50 bytes serialization) |
| π§ Custom Message Store | β Tested | Custom ChatMessageStoreProtocol implementation (converted from Python script) |
| π¦ Redis Message Store | Distributed conversation storage with 5 comprehensive examples | |
| π Suspend/Resume Threads | β Tested | Service-managed & in-memory thread persistence patterns (converted from Python script) |
| Notebook | Description |
|---|---|
| ποΈ Agent Observability | Trace LLM calls, tool executions, token usage with Application Insights |
| π¬ Chat Client Observability | Monitor Azure AI chat clients with multiple tools |
| Implementation | Description |
|---|---|
| π In-Memory Mode | Quick-start web interface for testing agents |
| π Sample Agents | Pre-built examples: Foundry agent, weather agent, spam workflow, fanout workflow |
Location: 7. observability-and-evaluations/
| Notebook | Description |
|---|---|
| ποΈ Observability | Monitoring and telemetry |
| π Evaluation | Quality assessment and benchmarking |
Location: 8. ai-language/
| Implementation | Description |
|---|---|
| π€ AI Language Service Lab | Low-code Logic Apps for PII removal, language detection, and translation. Build workflow solutions for processing multilingual customer feedback with privacy compliance and centralized analytics. |
Location: 9. ai-vision/
| Implementation | Description |
|---|---|
| π AI Vision Lab Guide | Azure AI Vision low-code exercises including OCR, face detection, image analysis, and video indexing using Vision Studio |
| π AI Vision Services Notebook | Hands-on Jupyter notebook for computer vision capabilities |
Location: 10. content-understanding/
| Implementation | Description |
|---|---|
| π Content Understanding Lab Guide | Azure AI Content Understanding for document classification and field extraction from bundled PDF files |
| π Classifier Notebook | Hands-on Jupyter notebook for building document classifiers and analyzers |
| π Content Understanding Client | Python client implementation for Azure AI Content Understanding API |
| π Sample Data | Sample PDF documents for testing classification and extraction workflows |
Location: 11. responsible-ai/
| Implementation | Description |
|---|---|
| π‘οΈ Responsible AI Lab Guide | Comprehensive exploration of AI safety including manual and automated evaluations, content safety filters, PII detection and masking |
| π Evaluation Data | Manual and automated evaluation datasets for AI model testing |
| π‘οΈ Content Safety Data | Bulk datasets for text and image moderation testing |
| π Sample Documents | Corporate documents for PII detection and content analysis exercises |
Essential Components:
- π .NET 10+ - Latest LTS version
- βοΈ Azure Subscription - Active subscription with Azure AI Foundry access
- π» Visual Studio Code - Recommended development environment
- π οΈ Azure CLI - For resource management
- π¦ Git - Version control
Knowledge Prerequisites:
- β Intermediate .NET / C# programming skills
- β Basic understanding of machine learning concepts
- β Familiarity with REST APIs and web services
- β Experience with Azure services (recommended)
Visual Studio Code (Recommended)
# Install required extensions
code --install-extension ms-dotnettools.vscode-dotnet-packAzure Authentication Issues:
# Recommended: Use Azure CLI authentication
az login --tenant YOUR_TENANT_ID
az account show
# Alternative: Clear cached credentials and re-login
az account clear
az login --tenant YOUR_TENANT_ID
az account showNote: If you see deprecation warnings about the Azure Account extension in VS Code, use
az loginin the terminal instead. The Azure Account extension for VS Code has been deprecated in favor of Azure CLI authentication.
- π Azure AI Foundry Documentation
- π₯ Video Tutorials
- π‘ Best Practices Guide
- π GitHub Issues - Report bugs or request features
- π Documentation: Improve clarity and add examples
- π Bug Reports: Help us identify and fix issues
- π‘ Feature Requests: Suggest new capabilities and improvements
- π Pull Requests: Contribute code and enhancements
Please review our Contributing Guide for:
- Code style and formatting standards
- Testing requirements and procedures
- Pull request process and review criteria
- Community guidelines and expectations
License: MIT License
Repository: github.com/microsoft/agentic-ai-lab-dotnet


