# Prerequisites for Using AI Agents for Beginners: Complete Setup Guide

> Master AI agents for beginners by setting up Python 3.12, Azure CLI, and a Microsoft Foundry project with GPT-4o. Get started easily.

- Repository: [Microsoft/ai-agents-for-beginners](https://github.com/microsoft/ai-agents-for-beginners)
- Tags: complete-setup-guide
- Published: 2026-04-22

---

**To run the AI Agents for beginners course, you need Python 3.12+, an Azure subscription with Azure CLI installed, and a Microsoft Foundry project with a deployed model like GPT-4o.**

The **AI Agents for beginners** repository from Microsoft is a hands-on course built around Jupyter notebooks that demonstrate agentic AI patterns using the **Microsoft Agent Framework (MAF)** and **Azure AI Foundry Agent Service V2**. This guide covers every prerequisite you need to configure before running the first notebook.

## Core Runtime Requirements

### Python 3.12 or Newer

The course relies on modern Python features and pinned package versions. In [`00-course-setup/README.md`](https://github.com/microsoft/ai-agents-for-beginners/blob/main/00-course-setup/README.md) (lines 94-100), Microsoft explicitly requires **Python 3.12+** to ensure compatibility with the `agent-framework` and `azure-identity` libraries.

```bash

# Verify your Python version

python --version  # Should show 3.12.x or higher

```

### Optional .NET 10 for C# Samples

If you plan to run the C#-based examples, you'll need **.NET 10 or newer** as noted in [`00-course-setup/README.md`](https://github.com/microsoft/ai-agents-for-beginners/blob/main/00-course-setup/README.md) (lines 19-24).

## Azure Cloud Prerequisites

### Azure CLI and Active Subscription

The notebooks authenticate using **AzureCliCredential**, which requires:

1. **Azure CLI installed** – Used for authentication without storing secrets in code ([`00-course-setup/README.md`](https://github.com/microsoft/ai-agents-for-beginners/blob/main/00-course-setup/README.md), lines 25-27)
2. **Active Azure subscription** – Required to provision Foundry resources and run the agent service (lines 26-28)

```bash

# Install Azure CLI (macOS example)

brew install azure-cli

# Authenticate

az login

# Verify active subscription

az account show

```

### Microsoft Foundry Project with Deployed Model

In [`00-course-setup/README.md`](https://github.com/microsoft/ai-agents-for-beginners/blob/main/00-course-setup/README.md) (lines 45-55), Microsoft specifies that you must create:

- A **Microsoft Foundry hub and project**
- A **deployed model** (recommended: `gpt-4o`)

You will copy two values from this setup into your `.env` file:
- **Project endpoint** – The URL for your Foundry project
- **Deployment name** – The name of your deployed model

## Environment Configuration

### Required .env Variables

Every notebook loads configuration from a `.env` file. Copy `.env.example` to create your own:

```bash
cp .env.example .env

```

The **minimum required variables** are:

| Variable | Source | Purpose |
|----------|--------|---------|
| `AZURE_AI_PROJECT_ENDPOINT` | Foundry project overview page | Tells MAF where to send requests |
| `AZURE_AI_MODEL_DEPLOYMENT_NAME` | Model deployment list | Identifies which model to use |

### Optional Service-Specific Variables

Depending on which lessons you run, you may need additional configuration ([`00-course-setup/README.md`](https://github.com/microsoft/ai-agents-for-beginners/blob/main/00-course-setup/README.md)):

- **Lesson 5 (RAG)**: `AZURE_SEARCH_SERVICE_ENDPOINT`, `AZURE_SEARCH_API_KEY` (lines 30-38)
- **Lessons 6 & 8**: `GITHUB_TOKEN`, `GITHUB_ENDPOINT`, `GITHUB_MODEL_ID` for GitHub Models (lines 39-47)
- **Lesson 8 (Grounding)**: `BING_CONNECTION_ID` for Bing search integration (lines 65-71)

## Development Environment Setup

### Virtual Environment and Dependencies

Microsoft recommends isolating Python packages to ensure reproducible notebook execution ([`00-course-setup/README.md`](https://github.com/microsoft/ai-agents-for-beginners/blob/main/00-course-setup/README.md), lines 31-33):

```bash

# Create virtual environment

python -m venv .venv

# Activate (macOS/Linux)

source .venv/bin/activate

# Activate (Windows)

.venv\Scripts\activate

# Install pinned dependencies

pip install -r requirements.txt

```

### Efficient Repository Cloning

The repository includes ~3GB of translated notebooks. To avoid downloading unnecessary files, use a sparse or shallow clone ([`00-course-setup/README.md`](https://github.com/microsoft/ai-agents-for-beginners/blob/main/00-course-setup/README.md), lines 21-38):

```bash

# Shallow clone (latest commit only)

git clone --depth 1 https://github.com/microsoft/ai-agents-for-beginners.git

# Or sparse clone (English only)

git clone --filter=blob:none --sparse https://github.com/microsoft/ai-agents-for-beginners.git
cd ai-agents-for-beginners
git sparse-checkout set 00-course-setup 01-intro-to-ai-agents 02-explore-agentic-frameworks

```

## Bootstrap Code Pattern

Every lesson notebook follows the same initialization pattern. This snippet from `01-intro-to-ai-agents/code_samples/01-python-agent-framework.ipynb` demonstrates how the prerequisites connect at runtime:

```python
import os
from dotenv import load_dotenv
from azure.identity import AzureCliCredential
from agent_framework import AzureAIProjectAgentProvider

# Load .env (created from .env.example)

load_dotenv()

# Required variables – will raise if missing

project_endpoint = os.getenv("AZURE_AI_PROJECT_ENDPOINT")
deployment_name = os.getenv("AZURE_AI_MODEL_DEPLOYMENT_NAME")

credential = AzureCliCredential()  # uses `az login` session

# Create the MAF provider that backs all agent calls

provider = AzureAIProjectAgentProvider(
    endpoint=project_endpoint,
    deployment_name=deployment_name,
    credential=credential,
)

# Example: instantiate a simple agent

from agent_framework import Agent

agent = Agent(provider=provider, name="starter-agent")
print(agent.get_capabilities())

```

This bootstrap pattern:
- **`load_dotenv()`** reads your `.env` configuration
- **`AzureCliCredential`** leverages your `az login` session for secure authentication
- **`AzureAIProjectAgentProvider`** establishes the connection to your Foundry project

## Key Setup Files Reference

| File | Purpose | Location |
|------|---------|----------|
| [`README.md`](https://github.com/microsoft/ai-agents-for-beginners/blob/main/README.md) | Course overview, lesson table, high-level prerequisites | Repository root |
| [`00-course-setup/README.md`](https://github.com/microsoft/ai-agents-for-beginners/blob/main/00-course-setup/README.md) | Detailed installation steps for all prerequisites | `00-course-setup/` |
| `.env.example` | Template with all required and optional environment variables | Repository root |
| [`requirements.txt`](https://github.com/microsoft/ai-agents-for-beginners/blob/main/requirements.txt) | Pinned Python dependencies | Repository root |
| `01-python-agent-framework.ipynb` | First working example of the bootstrap pattern | `01-intro-to-ai-agents/code_samples/` |

## Summary

- **Python 3.12+** is mandatory; **.NET 10+** is optional for C# samples

- **Azure CLI** and an **active Azure subscription** enable authentication and resource provisioning
- A **Microsoft Foundry project** with a **deployed GPT-4o model** provides the LLM backend
- **Two environment variables** (`AZURE_AI_PROJECT_ENDPOINT`, `AZURE_AI_MODEL_DEPLOYMENT_NAME`) are the minimum required configuration
- **Optional services** extend capabilities for specific lessons: Azure AI Search, GitHub Models, MiniMax, and Bing grounding
- Use **sparse or shallow git clones** to avoid downloading 3GB of translation files

## Frequently Asked Questions

### Can I run the notebooks without an Azure subscription?

No. The **AI Agents for beginners** course requires an Azure subscription to provision a Microsoft Foundry project and access the Azure AI Foundry Agent Service V2. According to the setup documentation in [`00-course-setup/README.md`](https://github.com/microsoft/ai-agents-for-beginners/blob/main/00-course-setup/README.md), the `AzureAIProjectAgentProvider` class connects exclusively to Azure-hosted endpoints.

### What is the minimum Python version required?

**Python 3.12** is the minimum version required. The [`requirements.txt`](https://github.com/microsoft/ai-agents-for-beginners/blob/main/requirements.txt) file pins dependencies that rely on Python 3.12+ features, and some notebooks use syntax introduced in recent Python versions. The setup guide explicitly warns against using older Python versions in [`00-course-setup/README.md`](https://github.com/microsoft/ai-agents-for-beginners/blob/main/00-course-setup/README.md) (lines 94-100).

### Do I need to install all optional services before starting?

No. You only need the **core prerequisites** (Python, Azure CLI, Foundry project, and the two required environment variables) to run the first lessons. Optional services like **Azure AI Search**, **GitHub Models**, and **Bing grounding** are only required for specific lessons as noted in [`00-course-setup/README.md`](https://github.com/microsoft/ai-agents-for-beginners/blob/main/00-course-setup/README.md). You can add these configurations progressively as you advance through the course.