Azure-AI_Foundry

Azure AI Foundry — Hands-On Lab Index

Each lab maps to a module in the syllabus. Complete labs in order unless you already have the prerequisite skills.

Cost Note: Most labs use pay-as-you-go resources. Estimated costs assume you follow the cleanup steps. Leaving resources running will incur charges.


Lab Summary Table

Lab Title Module Difficulty Est. Time Est. Cost
01 Create Your First Hub and Project 1 Beginner 45 min Free
02 Deploy and Compare Models 2 Beginner 60 min ~$2
03 Prompt Engineering in the Playground 3 Beginner 60 min ~$1
04 Build a Chat App with the AI SDK 4 Intermediate 90 min ~$2
05 Build a RAG Application 5 Intermediate 120 min ~$5
06 Advanced RAG Optimization 6 Intermediate 120 min ~$5
07 Build an AI Agent with Tools 7 Intermediate 90 min ~$3
08 Evaluate Your AI Application 8 Intermediate 90 min ~$3
09 Content Safety & Responsible AI 9 Intermediate 60 min ~$2
10 Fine-Tune a Model 10 Advanced 180 min ~$15–50
11 CI/CD Pipeline for AI Foundry 11 Advanced 150 min ~$5
12 Capstone: End-to-End AI Application 12 Advanced 240 min ~$10–20

Lab 01 — Create Your First Hub and Project

Module: 1 — Introduction to Azure AI Foundry Difficulty: Beginner Estimated Time: 45 minutes Estimated Cost: Free (Hub and Project have no direct cost)

Prerequisites

Azure Resources Created

| Resource | SKU / Tier | |———-|———–| | Resource Group | — | | Azure AI Foundry Hub | Standard | | Azure AI Foundry Project | — | | Azure Storage Account | Standard LRS | | Azure Key Vault | Standard |

Objectives

  1. Create a resource group for the course.
  2. Create an Azure AI Foundry Hub via the portal (docs).
  3. Create a Project inside the Hub.
  4. Explore the Hub and Project settings.
  5. Create the same Hub and Project using Azure CLI.
  6. Verify connectivity from VS Code.

Walkthrough

See course/labs/lab-01-hub-project.md (to be created).

Cleanup

# Delete the resource group to remove all resources
az group delete --name rg-ai-foundry-course --yes --no-wait

Lab 02 — Deploy and Compare Models

Module: 2 — Models & Model Catalog Difficulty: Beginner Estimated Time: 60 minutes Estimated Cost: ~$2 (pay-as-you-go inference)

Prerequisites

Azure Resources Created

| Resource | SKU / Tier | |———-|———–| | GPT-4o Model Deployment | Standard (PAYG) | | Open-source Model Deployment (e.g., Llama or Mistral) | Serverless API |

Objectives

  1. Browse the Model Catalog in the portal (docs).
  2. Deploy a GPT-4o model with Standard deployment.
  3. Deploy an open-source model via Serverless API.
  4. Compare outputs from both models on the same prompt.
  5. Review deployment settings: TPM limits, content filters.
  6. Test both endpoints with curl.

Walkthrough

See course/labs/lab-02-model-deployment.md.

Cleanup

# Delete model deployments from the portal or CLI
az ai model deployment delete --name gpt-4o-deployment --project <project-name> --hub <hub-name>

Lab 03 — Prompt Engineering in the Playground

Module: 3 — Playground & Prompt Engineering Difficulty: Beginner Estimated Time: 60 minutes Estimated Cost: ~$1 (token usage)

Prerequisites

Azure Resources Created

No additional resources — uses existing model deployments.

Objectives

  1. Open the Chat Playground in the AI Foundry portal.
  2. Configure system prompts for different personas.
  3. Experiment with temperature (0.0 → 1.0) and top-p.
  4. Practice few-shot prompting with examples.
  5. Use chain-of-thought prompting for reasoning tasks.
  6. Export a playground session to Python code.

Walkthrough

See course/labs/lab-03-prompt-engineering.md.

Cleanup

No cleanup needed — no persistent resources created.


Lab 04 — Build a Chat App with the AI SDK

Module: 4 — Azure AI SDKs & Code-First Development Difficulty: Intermediate Estimated Time: 90 minutes Estimated Cost: ~$2 (token usage)

Prerequisites

Azure Resources Created

No additional resources — uses existing model deployments.

Objectives

  1. Install the Azure AI SDKs.
  2. Authenticate using DefaultAzureCredential (docs).
  3. Send a chat completion request via azure-ai-inference.
  4. Handle streaming responses.
  5. Build a simple CLI chat application with conversation history.
  6. Call the REST API directly with curl and compare.

Walkthrough

See course/labs/lab-04-chat-sdk.md.

Cleanup

No infrastructure cleanup — deactivate your Python virtual environment.


Lab 05 — Build a RAG Application

Module: 5 — RAG Fundamentals Difficulty: Intermediate Estimated Time: 120 minutes Estimated Cost: ~$5 (AI Search + inference)

Prerequisites

Azure Resources Created

| Resource | SKU / Tier | |———-|———–| | Azure AI Search | Basic | | Azure Blob Storage container | (uses existing storage account) |

Objectives

  1. Create an Azure AI Search resource (docs).
  2. Upload sample documents to Blob Storage.
  3. Create a search index with vector fields.
  4. Generate embeddings using an embedding model.
  5. Implement RAG: retrieve → augment → generate.
  6. Test in the Playground using “Add your data” (docs).

Walkthrough

See course/labs/lab-05-rag-basics.md.

Cleanup

# Delete AI Search to stop charges
az search service delete --name <search-name> --resource-group rg-ai-foundry-course --yes
# Delete uploaded blob data
az storage blob delete-batch --account-name <storage> --source docs

Lab 06 — Advanced RAG Optimization

Module: 6 — Advanced RAG & Search Optimization Difficulty: Intermediate Estimated Time: 120 minutes Estimated Cost: ~$5

Prerequisites

Azure Resources Created

No additional resources — enhances Lab 05 setup.

Objectives

  1. Enable hybrid search (vector + keyword) (docs).
  2. Add semantic ranking to the index.
  3. Implement a reranking step with a cross-encoder or semantic ranker.
  4. Test different chunk sizes (256, 512, 1024 tokens) and measure quality.
  5. Implement multi-turn conversation with context window management.
  6. Compare retrieval quality metrics across configurations.

Walkthrough

See course/labs/lab-06-advanced-rag.md.

Cleanup

Same as Lab 05 — delete AI Search when done if not continuing to Lab 07.


Lab 07 — Build an AI Agent with Tools

Module: 7 — AI Agents & Tool Use Difficulty: Intermediate Estimated Time: 90 minutes Estimated Cost: ~$3

Prerequisites

Azure Resources Created

| Resource | SKU / Tier | |———-|———–| | AI Agent (via Agent Service) | Standard |

Objectives

  1. Create an AI Agent with the Azure AI Agent Service (docs).
  2. Add function calling with custom tools.
  3. Enable Code Interpreter for data analysis.
  4. Enable File Search for document Q&A.
  5. Implement error handling and retry logic.
  6. Build a multi-step workflow with agent orchestration.

Walkthrough

See course/labs/lab-07-agents.md.

Cleanup

# Delete agents via SDK
project_client.agents.delete_agent(agent.id)

Lab 08 — Evaluate Your AI Application

Module: 8 — Evaluation & Quality Difficulty: Intermediate Estimated Time: 90 minutes Estimated Cost: ~$3 (evaluator inference costs)

Prerequisites

Azure Resources Created

No additional resources — evaluation runs locally and in the portal.

Objectives

  1. Install the azure-ai-evaluation SDK (docs).
  2. Prepare a test dataset (query + ground truth + response).
  3. Run built-in evaluators: Groundedness, Relevance, Coherence, Fluency.
  4. Create a custom evaluator for domain-specific quality.
  5. View evaluation results in the AI Foundry portal.
  6. Compare evaluation results across model versions.

Walkthrough

See course/labs/lab-08-evaluation.md.

Cleanup

No infrastructure cleanup — evaluation data stored in project.


Lab 09 — Content Safety & Responsible AI

Module: 9 — Content Safety & Responsible AI Difficulty: Intermediate Estimated Time: 60 minutes Estimated Cost: ~$2

Prerequisites

Azure Resources Created

| Resource | SKU / Tier | |———-|———–| | Azure AI Content Safety | Free/Standard |

Objectives

  1. Configure content filters on a model deployment (docs).
  2. Test filter thresholds for hate, violence, self-harm, sexual content.
  3. Implement Prompt Shields for jailbreak detection.
  4. Add groundedness detection to a RAG app.
  5. Evaluate safety metrics using azure-ai-evaluation.
  6. Review the responsible AI dashboard in the portal.

Walkthrough

See course/labs/lab-09-content-safety.md.

Cleanup

# Content filters are deployment settings — no separate resource to delete
# Delete the Content Safety resource if created standalone
az cognitiveservices account delete --name <safety-resource> --resource-group rg-ai-foundry-course

Lab 10 — Fine-Tune a Model

Module: 10 — Fine-Tuning Models Difficulty: Advanced Estimated Time: 180 minutes (includes training time) Estimated Cost: ~$15–50 (depends on model size and training duration)

Prerequisites

Azure Resources Created

| Resource | SKU / Tier | |———-|———–| | Fine-tuning job | — | | Fine-tuned model deployment | Standard |

Objectives

  1. Prepare and validate training data in JSONL format (format guide).
  2. Upload training data to the project.
  3. Submit a fine-tuning job via the portal.
  4. Submit a fine-tuning job via the SDK.
  5. Monitor training progress and review training metrics.
  6. Deploy and evaluate the fine-tuned model vs. the base model.

Walkthrough

See course/labs/lab-10-fine-tuning.md.

Cleanup

# Delete the fine-tuned model deployment
az ai model deployment delete --name ft-model-deployment --project <project> --hub <hub>
# Delete the fine-tuned model (stop ongoing training costs)

Lab 11 — CI/CD Pipeline for AI Foundry

Module: 11 — MLOps, CI/CD & Enterprise Deployment Difficulty: Advanced Estimated Time: 150 minutes Estimated Cost: ~$5

Prerequisites

Azure Resources Created

| Resource | SKU / Tier | |———-|———–| | Azure Service Principal | — | | GitHub Actions Workflow | — |

Objectives

  1. Create a service principal for CI/CD (docs).
  2. Set up GitHub repository with Azure AI project code.
  3. Build a GitHub Actions workflow: lint → test → evaluate → deploy.
  4. Automate evaluation as a quality gate.
  5. Implement blue/green deployment for model endpoints.
  6. Add monitoring alerts for production endpoints.

Walkthrough

See course/labs/lab-11-cicd.md.

Cleanup

# Delete service principal
az ad sp delete --id <sp-app-id>
# Remove GitHub Actions secrets

Lab 12 — Capstone: End-to-End AI Application

Module: 12 — Multi-Modal, Advanced Patterns & Capstone Difficulty: Advanced Estimated Time: 240 minutes (4 hours) Estimated Cost: ~$10–20

Prerequisites

Azure Resources Created

Varies by project choice — plan resources before starting.

Objectives

Build a complete AI application that combines at least 3 of the following:

  1. Multi-model deployment (GPT-4o + an open-source model).
  2. RAG with Azure AI Search and optimized retrieval.
  3. AI Agent with custom tools and function calling.
  4. Content safety filters and responsible AI evaluation.
  5. Multi-modal input (text + images or speech).
  6. CI/CD deployment pipeline with automated evaluation.

Suggested Capstone Projects

| Project | Techniques Combined | |———|——————-| | Enterprise Knowledge Assistant | RAG + Agents + Content Safety + Evaluation | | Multi-Modal Customer Support Bot | Vision + Speech + RAG + Agents | | Automated Document Processor | Vision + RAG + Fine-Tuning + CI/CD | | AI-Powered Code Reviewer | Agents + Evaluation + CI/CD + Content Safety |

Walkthrough

See course/labs/lab-12-capstone.md.

Cleanup

# IMPORTANT: Delete ALL course resources when finished
az group delete --name rg-ai-foundry-course --yes --no-wait

General Cleanup Checklist

After completing the course (or pausing for an extended period), ensure you clean up:


References