Five lessons, learn how to really apply AI to your .NET Applications
3,049
stars
935
commits
C#
primary language
Aug 31, 2026
updated

Welcome to Generative AI for Beginners .NET, the hands-on course for .NET developers diving into the world of Generative AI!
This isn’t your typical “here’s some theory, good luck” course. This repository is all about real-world applications and live coding to empower .NET developers to take full advantage of Generative AI.
This is hands-on, practical, and designed to be fun!
Don't forget to star (🌟) this repo to find it easier later.
➡️Get your own copy by Forking this repo and find it next in your own repositories.
We're constantly improving this course with the latest AI tools, models, and practical samples:
🖥️ Local AI with Foundry Local — 10 samples (August 2026)
Run Generative AI models locally from .NET using Microsoft Foundry Local. Ten production-ready samples demonstrate chat, streaming, practical scenarios, audio transcription, agent tools, and live speech-to-text—including multilingual transcription with automatic language detection and explicit locale selection—all with zero cloud costs and full offline capability.
🚀 Microsoft Agent Framework v1.0 GA (April 2026)
All 28 MAF samples upgraded from preview to stable v1.0 packages. This includes a breaking change: Microsoft.Agents.AI.AzureAI renamed to Microsoft.Agents.AI.Foundry.
2 new Hosted Agent scenarios — deploy containerized agents to Azure Foundry Agent Service:
Multi-agent workflows, streaming, persistence, and MCP all production-ready.
🚀 Microsoft Agent Framework Reaches Release Candidate!
Microsoft Agent Framework has reached Release Candidate (1.0.0-rc1) — a framework for building agents and multi-agent systems in .NET. Our samples are being migrated to the RC APIs. In the meantime, explore 25+ Agent Framework samples covering console apps, web chat, multi-agent workflows, and Foundry integration.
🧪 Optional provider-specific samples
Additional provider-specific samples remain available in the repo, including Claude-via-Foundry integrations and legacy video-generation experiments. They are useful reference material, but they are not part of the current recommended beginner-to-advanced learning path.
View all previous updates in our What's New archive
Generative AI is transforming software development, and .NET is no exception. This course aims to simplify the journey by offering:
You'll learn how to implement Generative AI into .NET projects, from basic text generation to building full-fledged solutions using Azure OpenAI Services and local models with Ollama.
| # | Lesson Link | Description |
|---|---|---|
| 01 | Introduction to Generative AI |
|
| 02 | Generative AI Techniques |
|
| 03 | AI Patterns and Applications |
|
| 04 | AI Agents with Microsoft Agent Framework |
|
| 05 | Responsible AI |
|
| Language | Code | Link to Translated README | Last Updated |
|---|---|---|---|
| Chinese (Simplified) | zh | Chinese Translation | 2025-06-24 |
| Chinese (Traditional) | tw | Chinese Translation | 2025-06-24 |
| French | fr | French Translation | 2025-06-24 |
| Japanese | ja | Japanese Translation | 2025-06-24 |
| Korean | ko | Korean Translation | 2025-06-24 |
| Portuguese | pt | Portuguese Translation | 2025-06-24 |
| Spanish | es | Spanish Translation | 2025-06-24 |
| German | de | German Translation | 2025-06-24 |
Note: All translations were updated to match the original content on 2025-06-24. See PR #161 for details.
To get started, you'll need:
A GitHub account (free is fine!) to fork this entire repo to your own GitHub account.
GitHub Codespaces enabled for instant coding environments. You can enable GitHub Codespaces in your repository settings. Learn more about GitHub Codespaces here.
Create your copy by Forking this repo, or use the Fork button at the top of this page.
A basic understanding of .NET development. Learn more about .NET here.
Azure Developer CLI (azd) — Install here (required for automated Azure setup)
An Azure account — Create a free account here (a free account works!)
And that's it.
We've designed this course to be as low-friction as possible. We make use of the following to help you get started quickly:
Then when you're ready to expand we also have guides for:
For first-time Azure users, we provide an automated setup script that deploys all necessary resources:
# Navigate to the repository root
cd Generative-AI-for-beginners-dotnet
# Run the setup script
./setup.ps1
This will:
For detailed instructions, see Azure Resource Setup Guide.
If you already have an Azure OpenAI account and the models deployed, configure secrets directly:
# Set shared secrets (used by all samples)
dotnet user-secrets set --id genai-beginners-dotnet "AzureOpenAI:Endpoint" "https://<your-region>.openai.azure.com/"
dotnet user-secrets set --id genai-beginners-dotnet "AzureOpenAI:Deployment" "gpt-5-mini"
dotnet user-secrets set --id genai-beginners-dotnet "AzureOpenAI:EmbeddingDeployment" "text-embedding-3-small"
Then navigate to any sample and run:
cd samples/CoreSamples/BasicChat-01MEAI
dotnet run app.cs
Note: Azure OpenAI samples use
az loginfor authentication. Runaz loginbefore running any Azure sample.
For detailed manual setup options, see Azure Resource Setup Guide.
When you're done with the course, clean up Azure resources to avoid ongoing charges:
./cleanup.ps1
This will:
Learn more in Azure Resource Setup Guide - Cleanup.
Contributions are welcome! Here's how you can help:
Report issues or bugs in the repo.
Improve existing code samples or add new ones, fork this repo and propose some changes!
Suggest additional lessons or enhancements.
Do you have suggestions or found spelling or code errors?, create a pull request
Check the CONTRIBUTING.MD file for details on how to get involved.
This project is licensed under the MIT License - see the LICENSE file for details.
We have a lot of other content to help your learning journey. Check out:
If you get stuck or have any questions about building AI apps, join:
If you have product feedback or errors while building visit:
(top 30 of 33)
C#
49.3%
PowerShell
25.0%
JavaScript
16.5%
Bicep
3.9%
Shell
3.6%
TypeScript
1.7%
Five lessons, learn how to really apply AI to your .NET Applications
3,049
stars
935
commits
C#
primary language
Aug 31, 2026
updated

Welcome to Generative AI for Beginners .NET, the hands-on course for .NET developers diving into the world of Generative AI!
This isn’t your typical “here’s some theory, good luck” course. This repository is all about real-world applications and live coding to empower .NET developers to take full advantage of Generative AI.
This is hands-on, practical, and designed to be fun!
Don't forget to star (🌟) this repo to find it easier later.
➡️Get your own copy by Forking this repo and find it next in your own repositories.
We're constantly improving this course with the latest AI tools, models, and practical samples:
🖥️ Local AI with Foundry Local — 10 samples (August 2026)
Run Generative AI models locally from .NET using Microsoft Foundry Local. Ten production-ready samples demonstrate chat, streaming, practical scenarios, audio transcription, agent tools, and live speech-to-text—including multilingual transcription with automatic language detection and explicit locale selection—all with zero cloud costs and full offline capability.
🚀 Microsoft Agent Framework v1.0 GA (April 2026)
All 28 MAF samples upgraded from preview to stable v1.0 packages. This includes a breaking change: Microsoft.Agents.AI.AzureAI renamed to Microsoft.Agents.AI.Foundry.
2 new Hosted Agent scenarios — deploy containerized agents to Azure Foundry Agent Service:
Multi-agent workflows, streaming, persistence, and MCP all production-ready.
🚀 Microsoft Agent Framework Reaches Release Candidate!
Microsoft Agent Framework has reached Release Candidate (1.0.0-rc1) — a framework for building agents and multi-agent systems in .NET. Our samples are being migrated to the RC APIs. In the meantime, explore 25+ Agent Framework samples covering console apps, web chat, multi-agent workflows, and Foundry integration.
🧪 Optional provider-specific samples
Additional provider-specific samples remain available in the repo, including Claude-via-Foundry integrations and legacy video-generation experiments. They are useful reference material, but they are not part of the current recommended beginner-to-advanced learning path.
View all previous updates in our What's New archive
Generative AI is transforming software development, and .NET is no exception. This course aims to simplify the journey by offering:
You'll learn how to implement Generative AI into .NET projects, from basic text generation to building full-fledged solutions using Azure OpenAI Services and local models with Ollama.
| # | Lesson Link | Description |
|---|---|---|
| 01 | Introduction to Generative AI |
|
| 02 | Generative AI Techniques |
|
| 03 | AI Patterns and Applications |
|
| 04 | AI Agents with Microsoft Agent Framework |
|
| 05 | Responsible AI |
|
| Language | Code | Link to Translated README | Last Updated |
|---|---|---|---|
| Chinese (Simplified) | zh | Chinese Translation | 2025-06-24 |
| Chinese (Traditional) | tw | Chinese Translation | 2025-06-24 |
| French | fr | French Translation | 2025-06-24 |
| Japanese | ja | Japanese Translation | 2025-06-24 |
| Korean | ko | Korean Translation | 2025-06-24 |
| Portuguese | pt | Portuguese Translation | 2025-06-24 |
| Spanish | es | Spanish Translation | 2025-06-24 |
| German | de | German Translation | 2025-06-24 |
Note: All translations were updated to match the original content on 2025-06-24. See PR #161 for details.
To get started, you'll need:
A GitHub account (free is fine!) to fork this entire repo to your own GitHub account.
GitHub Codespaces enabled for instant coding environments. You can enable GitHub Codespaces in your repository settings. Learn more about GitHub Codespaces here.
Create your copy by Forking this repo, or use the Fork button at the top of this page.
A basic understanding of .NET development. Learn more about .NET here.
Azure Developer CLI (azd) — Install here (required for automated Azure setup)
An Azure account — Create a free account here (a free account works!)
And that's it.
We've designed this course to be as low-friction as possible. We make use of the following to help you get started quickly:
Then when you're ready to expand we also have guides for:
For first-time Azure users, we provide an automated setup script that deploys all necessary resources:
# Navigate to the repository root
cd Generative-AI-for-beginners-dotnet
# Run the setup script
./setup.ps1
This will:
For detailed instructions, see Azure Resource Setup Guide.
If you already have an Azure OpenAI account and the models deployed, configure secrets directly:
# Set shared secrets (used by all samples)
dotnet user-secrets set --id genai-beginners-dotnet "AzureOpenAI:Endpoint" "https://<your-region>.openai.azure.com/"
dotnet user-secrets set --id genai-beginners-dotnet "AzureOpenAI:Deployment" "gpt-5-mini"
dotnet user-secrets set --id genai-beginners-dotnet "AzureOpenAI:EmbeddingDeployment" "text-embedding-3-small"
Then navigate to any sample and run:
cd samples/CoreSamples/BasicChat-01MEAI
dotnet run app.cs
Note: Azure OpenAI samples use
az loginfor authentication. Runaz loginbefore running any Azure sample.
For detailed manual setup options, see Azure Resource Setup Guide.
When you're done with the course, clean up Azure resources to avoid ongoing charges:
./cleanup.ps1
This will:
Learn more in Azure Resource Setup Guide - Cleanup.
Contributions are welcome! Here's how you can help:
Report issues or bugs in the repo.
Improve existing code samples or add new ones, fork this repo and propose some changes!
Suggest additional lessons or enhancements.
Do you have suggestions or found spelling or code errors?, create a pull request
Check the CONTRIBUTING.MD file for details on how to get involved.
This project is licensed under the MIT License - see the LICENSE file for details.
We have a lot of other content to help your learning journey. Check out:
If you get stuck or have any questions about building AI apps, join:
If you have product feedback or errors while building visit:
(top 30 of 33)
C#
49.3%
PowerShell
25.0%
JavaScript
16.5%
Bicep
3.9%
Shell
3.6%
TypeScript
1.7%