Dis lesson go show how to run di code samples for dis course.
Before you start to clone your repo, join the AI Agents For Beginners Discord channel make you fit get help with setup, ask questions about di course, or connect with oda learners.
To start, please clone or fork di GitHub Repository. That one go create your own copy of di course material so you fit run, test, and tweak di code!
This fit do by clicking di link to fork di repo
You suppose don get your own forked version of dis course for di link below:

Di full repository fit big (~3 GB) when you download full history and all files. If you just dey attend workshop or you only need small number of lesson folders, shallow clone (or sparse clone) go avoid most of dat download by truncating history and/or skipping blobs.
Replace <your-username> in the commands below with your fork URL (or the upstream URL if you prefer).
To clone only di latest commit history (small download):
git clone --depth 1 https://github.com/<your-username>/ai-agents-for-beginners.git
To clone a specific branch:
git clone --depth 1 --branch <branch-name> https://github.com/<your-username>/ai-agents-for-beginners.git
Dis one dey use partial clone and sparse-checkout (requires Git 2.25+ and we recommend recent Git wey support partial clone):
git clone --depth 1 --filter=blob:none --sparse https://github.com/<your-username>/ai-agents-for-beginners.git
Traverse into di repo folder:
cd ai-agents-for-beginners
Then specify which folders you want (example below dey show two folders):
git sparse-checkout set 00-course-setup 01-intro-to-ai-agents
After you clone and verify di files, if you only need di files and wan free space (no git history), delete di repository metadata (πirreversible β you go lose all Git functionality: no commits, pulls, pushes, or history access).
# zsh/bash
rm -rf .git
# PowerShell
Remove-Item -Recurse -Force .git
Create new Codespace for dis repo via the GitHub UI.
Dis course get plenty Jupyter Notebooks wey you fit run to get hands-on experience building AI Agents.
Di code samples dey use Microsoft Agent Framework (MAF) with the AzureAIProjectAgentProvider, wey connects to Azure AI Agent Service V2 (the Responses API) through Microsoft Foundry.
All Python notebooks dem label *-python-agent-framework.ipynb.
NOTE: If you no get Python 3.12 installed, make sure say you install am. Then create your venv using python3.12 to make sure di correct versions go install from di requirements.txt file.
Example
Create Python venv directory:
python -m venv venv
Then activate di venv for:
# zsh/bash
source venv/bin/activate
# Command Prompt for Windows
venv\Scripts\activate
.NET 10+: For di sample codes wey dey use .NET, make sure you install .NET 10 SDK or later. Then, check your installed .NET SDK version:
dotnet --list-sdks
gpt-4o). See Step 1 below.We don include requirements.txt file for di root of this repository wey get all di required Python packages to run di code samples.
You fit install dem by running di command below for your terminal at di root of di repository:
pip install -r requirements.txt
We recommend say you create Python virtual environment to avoid any conflicts and issues.
Make sure say you dey use di correct Python version for VSCode.
You need Azure AI Foundry hub and project wey get deployed model to run di notebooks.
gpt-4o) from Models + Endpoints β Deploy model.From your project for di Microsoft Foundry portal:

gpt-4o).az loginAll notebooks use AzureCliCredential for authentication β no API keys to manage. E mean say you must sign in via di Azure CLI.
Install the Azure CLI if you never do am: aka.ms/installazurecli
Sign in by running:
az login
Or if you dey in a remote/Codespace environment without a browser:
az login --use-device-code
Select your subscription if prompted β choose di one wey contain your Foundry project.
Verify say you don sign in:
az account show
Why
az login? Di notebooks dey authenticate usingAzureCliCredentialfrom diazure-identitypackage. E mean say your Azure CLI session dey provide di credentials β no API keys or secrets for your.envfile. This na a security best practice.
.env FileCopy di example file:
# zsh/bash
cp .env.example .env
# PowerShell
Copy-Item .env.example .env
Open .env and fill in these two values:
AZURE_AI_PROJECT_ENDPOINT=https://<your-project>.services.ai.azure.com/api/projects/<your-project-id>
AZURE_AI_MODEL_DEPLOYMENT_NAME=gpt-4o
| Variable | Where to find am |
|---|---|
AZURE_AI_PROJECT_ENDPOINT |
Foundry portal β your project β Overview page |
AZURE_AI_MODEL_DEPLOYMENT_NAME |
Foundry portal β Models + Endpoints β your deployed modelβs name |
Na im for most lessons! Di notebooks go authenticate automatically through your az login session.
pip install -r requirements.txt
We recommend say you run dis inside di virtual environment wey you create earlier.
Lesson 5 dey use Azure AI Search for retrieval-augmented generation. If you plan to run dat lesson, add these variables to your .env file:
| Variable | Where to find am |
|---|---|
AZURE_SEARCH_SERVICE_ENDPOINT |
Azure portal β your Azure AI Search resource β Overview β URL |
AZURE_SEARCH_API_KEY |
Azure portal β your Azure AI Search resource β Settings β Keys β primary admin key |
Some notebooks for lessons 6 and 8 dey use GitHub Models instead of Azure AI Foundry. If you plan to run those samples, add these variables to your .env file:
| Variable | Where to find am |
|---|---|
GITHUB_TOKEN |
GitHub β Settings β Developer settings β Personal access tokens |
GITHUB_ENDPOINT |
Use https://models.inference.ai.azure.com (default value) |
GITHUB_MODEL_ID |
Model name to use (e.g. gpt-4o-mini) |
Di conditional workflow notebook for lesson 8 dey use Bing grounding via Azure AI Foundry. If you plan to run dat sample, add dis variable to your .env file:
| Variable | Where to find am |
|---|---|
BING_CONNECTION_ID |
Azure AI Foundry portal β your project β Management β Connected resources β your Bing connection β copy di connection ID |
If you dey on macOS and you encounter an error like:
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain
Dis na known issue with Python on macOS where di system SSL certificates no dey automatically trusted. Try di following solutions for order:
Option 1: Run Pythonβs Install Certificates script (recommended)
# Change 3.XX to the Python version wey you don install (for example, 3.12 or 3.13):
/Applications/Python\ 3.XX/Install\ Certificates.command
Option 2: Use connection_verify=False in your notebook (for GitHub Models notebooks only)
For di Lesson 6 notebook (06-building-trustworthy-agents/code_samples/06-system-message-framework.ipynb), commented-out workaround don already dey included. Uncomment connection_verify=False when you dey create di client:
client = ChatCompletionsClient(
endpoint=endpoint,
credential=AzureKeyCredential(token),
connection_verify=False, # Turn off SSL verification if you get certificate wahala
)
β οΈ Warning: Disabling SSL verification (
connection_verify=False) reduce security because e skip certificate validation. Use dis only as temporary workaround for development environments, never for production.
Option 3: Install and use truststore
pip install truststore
Then add di following at di top of your notebook or script before you make any network calls:
import truststore
truststore.inject_into_ssl()
If you get any issues running dis setup, join our Azure AI Community Discord or open an issue.
You don ready now to run di code for dis course. Happy to learn more about di world of AI Agents!
Intro to AI Agents and How Dem Dey Use Am
Make you note: Dem don use AI translation service Co-op Translator (https://github.com/Azure/co-op-translator) translate this document. Even though we dey try make am correct, make you sabi say automatic translations fit get mistakes or wrong translations. The original document for e original language suppose be the main authoritative source. If na critical information, e better make professional human translator handle am. We no go take responsibility for any misunderstanding or wrong interpretation wey fit come from this translation.