Build Your First AI Agent in .NET
Two days building an agent that reasons, uses tools and holds a conversation, in your stack.
- Format
- 2-Day Intensive
- Duration
- 2 days
- Group size
- 15 to 40
- Level
- Intermediate
Companies are shipping agents that book meetings, process invoices and answer support tickets. Your team has probably been asked when they can do the same.
Over two days they build one. Not a chat box over an API, but an agent that reasons about data, calls tools and holds a conversation that goes somewhere.
The project is a personal finance assistant. It understands natural language, retrieves transaction data, remembers what was said three turns ago, and helps someone make a better decision. Small enough to finish, real enough to be awkward in the places production is awkward.
We use Azure AI services throughout. The patterns and the code carry over to OpenAI, Anthropic and Google without rewriting.
The part most teams miss is knowing when not to build one. A good half of the second day is about that line. Where an agent earns the complexity, and where a plain function call would have done the job for a tenth of the cost.
What your team leaves with.
Outcomes · 5- A working agent running against a .NET backend, built by the team, not demoed at them
- Hands-on time with tool calling, memory and the agent loop
- Experience hardening an agent for production and exposing it over MCP
- A shared read on when an agent earns its place, and when a simpler call does the job
- Patterns the team can carry into your own codebase on Monday
How the days run.
2 daysWorking with Large Language Models
Start at the metal. Talk to a model over raw HTTP, then refactor behind a clean abstraction the rest of the workshop builds on.
- How models actually respond, and what that means for your code
- Prompt engineering basics
- Raw API calls, no abstractions
- Refactoring to IChatClient, and swapping provider in one line
Tool calling
Give the agent hands. Let it take actions and pull in data, and find out what makes a tool a model can actually use.
- Structured outputs
- Defining tools the agent can call
- Writing tool descriptions the model understands
- Retrieving data, and handling tool failures safely
The agent loop
Close the loop. Watch it reason, call tools and iterate toward an answer, then keep it from running away.
- How agents reason, plan and iterate
- Multi-step, multi-tool execution
- Iteration caps and guarding against runaway loops
Memory and context management
Stop the agent forgetting. Carry context across turns without blowing the context window.
- Why agents forget between turns
- Maintaining conversation history
- Summarising history as it grows
Trust, safety and production
Make it safe to ship. Confirm risky actions, defend against attacks, and see what the thing is actually doing.
- Why agents fail, and how to spot it
- Defending against prompt injection
- Confirming destructive actions before they run
- Retries, fallbacks and observability
Shipping your agent
Get it out of the console. Expose the agent over MCP, then look at where frameworks take it next.
- MCP fundamentals
- Exposing your agent as an MCP server
- Graduating to the Microsoft Agent Framework
- When to reach for multiple agents
Who it's for.
Hands-on- Developers who build APIs in C# and want to move past a chat box
- Teams with some exposure to prompts, completions and embeddings
- Anyone who would rather learn by building than by watching slides
- Their usual IDE
- .NET 10 SDK, Git and a GitHub account
- An Azure account, around 5 to 10 euros of usage per person
Adapted to your team.
Before the dayWhat's above is the shape, not a script. We start with a 30-minute call about your codebase, your stack and what your team has already tried. The exercises get rebuilt around that, and anything that doesn't apply to you gets cut.
- The examples, moved into your domain
- The depth, tuned to the room
- The length, from 2 days to what your calendar allows
Questions we get.
FAQ · 6Do we need to be on Azure for this?
No. We use Azure AI services on the day because it keeps everyone on the same footing, and the code carries over to OpenAI, Anthropic and Google without a rewrite. What your team leaves with is the pattern, not the vendor.
How much AI experience does the team need?
Some. It is pitched at intermediate and assumes your developers build APIs in C# and have met prompts, completions and embeddings at least once. Nobody needs to have built an agent before. That is the point of the two days.
What does it cost to run, on top of the workshop?
Around 5 to 10 euros of Azure usage per person, on their own account. Everything else your team already has. Their usual IDE, the .NET 10 SDK, Git and a GitHub account.
We are not sure we should be building an agent at all. Is this still worth it?
Probably more worth it. About half of day two is on where an agent earns its complexity and where a plain function call does the same job for a tenth of the cost. A team that leaves having decided not to build one has still got its money back.
Is 40 people too many for a hands-on workshop?
Forty is the ceiling, and it does change the day. Above about 25 the exercises run in pairs with more structure and less over-the-shoulder time. If your team is near the top of that range, say so on the call and we will talk about splitting it.
Can it be run remotely?
Yes, on site or remote. It is a build-along, so remote works as long as everyone has their environment ready before day one starts. The setup steps go out ahead of time.
Who runs it.
In the roomGui Ferreira facilitates start to finish. He's been writing software since 2006 and is a Microsoft MVP. There's no junior trainer and no handover.
guiferreira.meThe other workshops.
Catalogue · 2Request this workshop.
10 questions, 3 optionalTell us about the team who'd be in the room. We read every one of these. If it's a good fit, we'll set up a 30-minute call and send a proposal within 48 hours of it. If it isn't, we'll say so.