← Back
Milan Jovanovic June 24, 2026 3m

This C# Agent Reviews My PRs While I Sleep (Microsoft Foundry)

Read full transcript 2 segments
  1. If you're a .NET developer, you've If you're a .NET developer, you've probably been experimenting with probably been experimenting with probably been experimenting with integrating AI into your applications. integrating AI into your applications. integrating AI into your applications. And in today's video, I want to show you And in today's video, I want to show you And in today's video, I want to show you a practical example of how you can build a practical example of how you can build a practical example of how you can build a pull request review agent with some a pull request review agent with some a pull request review agent with some simple C# code and Microsoft Foundry. simple C# code and Microsoft Foundry. simple C# code and Microsoft Foundry. Foundry gives you access to more than Foundry gives you access to more than Foundry gives you access to more than 11,000 models, and for starters, I'm 11,000 models, and for starters, I'm 11,000 models, and for starters, I'm going to use GPT-5.4 mini. Now, we need going to use GPT-5.4 mini. Now, we need going to use GPT-5.4 mini. Now, we need to get access to this model somehow, and to get access to this model somehow, and to get access to this model somehow, and we can do this without even leaving VS we can do this without even leaving VS we can do this without even leaving VS Code. We're going to see the Foundry Code. We're going to see the Foundry Code. We're going to see the Foundry Toolkit for VS Code extension, which Toolkit for VS Code extension, which Toolkit for VS Code extension, which allows you to build with AI agents in allows you to build with AI agents in allows you to build with AI agents in Microsoft Foundry directly from your VS Microsoft Foundry directly from your VS Microsoft Foundry directly from your VS Code instance. Now, if you're not Code instance. Now, if you're not Code instance. Now, if you're not familiar, Microsoft Foundry is an familiar, Microsoft Foundry is an familiar, Microsoft Foundry is an agentic platform as a service that agentic platform as a service that agentic platform as a service that solves many of the pain points of solves many of the pain points of solves many of the pain points of integrating agents into your C# integrating agents into your C# integrating agents into your C# applications. If I open the Foundry applications. If I open the Foundry applications. If I open the Foundry Toolkit, I can get access to my projects Toolkit, I can get access to my projects Toolkit, I can get access to my projects and even create new projects directly in and even create new projects directly in and even create new projects directly in Foundry. And I've got a PR Reviewer Foundry. And I've got a PR Reviewer Foundry. And I've got a PR Reviewer project here. If I want to add more project here. If I want to add more project here. If I want to add more models, I can just deploy a new one. We models, I can just deploy a new one. We models, I can just deploy a new one. We have access to all of the latest have access to all of the latest have access to all of the latest frontier models. So, going back to our frontier models. So, going back to our frontier models. So, going back to our pull request reviewer, we've picked the pull request reviewer, we've picked the pull request reviewer, we've picked the model that we want to use, which is model that we want to use, which is model that we want to use, which is going to give us an endpoint where we going to give us an endpoint where we going to give us an endpoint where we can connect to our AI agent. And then can connect to our AI agent. And then can connect to our AI agent. And then the next step is what makes this example the next step is what makes this example the next step is what makes this example really powerful. I'm going to give it really powerful. I'm going to give it really powerful. I'm going to give it access to the GitHub MCP. This will access to the GitHub MCP. This will access to the GitHub MCP. This will allow my agent to use some of the allow my agent to use some of the allow my agent to use some of the available tools. And in this case, I'm available tools. And in this case, I'm available tools. And in this case, I'm allowing it to read my pull requests and allowing it to read my pull requests and allowing it to read my pull requests and also write a pull request review. And also write a pull request review. And also write a pull request review. And finally, we can construct our request,

  2. finally, we can construct our request, finally, we can construct our request, and I'm telling it to review a specific and I'm telling it to review a specific and I'm telling it to review a specific pull request inside of one of my pull request inside of one of my pull request inside of one of my repositories. One important detail is repositories. One important detail is repositories. One important detail is that here the agent loop runs in our own that here the agent loop runs in our own that here the agent loop runs in our own code. We're using Foundry models, but code. We're using Foundry models, but code. We're using Foundry models, but not Foundry agent service. So, not Foundry agent service. So, not Foundry agent service. So, observability, governance, and observability, governance, and observability, governance, and compliance are on us. For production, compliance are on us. For production, compliance are on us. For production, agent service gives you the managed path agent service gives you the managed path agent service gives you the managed path to deploy, scale, monitor, and govern to deploy, scale, monitor, and govern to deploy, scale, monitor, and govern agents in Azure. And to actually run agents in Azure. And to actually run agents in Azure. And to actually run this, you can just use dotnet run. I this, you can just use dotnet run. I this, you can just use dotnet run. I send the environment variables and if I send the environment variables and if I send the environment variables and if I execute this, our agent connects to execute this, our agent connects to execute this, our agent connects to Foundry and then it's going to use the Foundry and then it's going to use the Foundry and then it's going to use the GitHub MCP server to fetch the pull GitHub MCP server to fetch the pull GitHub MCP server to fetch the pull request info, look at the changed files, request info, look at the changed files, request info, look at the changed files, and come back with a review. And then and come back with a review. And then and come back with a review. And then it's going to post it on my behalf it's going to post it on my behalf it's going to post it on my behalf inside of my actual repo. So, you can inside of my actual repo. So, you can inside of my actual repo. So, you can see that I left a review on my pull see that I left a review on my pull see that I left a review on my pull request and here's the review generated request and here's the review generated request and here's the review generated by our AI agent. And what makes all of by our AI agent. And what makes all of by our AI agent. And what makes all of this so powerful, if I want to change a this so powerful, if I want to change a this so powerful, if I want to change a model, all I have to do is swap out the model, all I have to do is swap out the model, all I have to do is swap out the model that I'm using here, for example, model that I'm using here, for example, model that I'm using here, for example, GPT-5.4, and you can even leverage the GPT-5.4, and you can even leverage the GPT-5.4, and you can even leverage the model router that exists inside of model router that exists inside of model router that exists inside of Foundry, which is going to automatically Foundry, which is going to automatically Foundry, which is going to automatically route the incoming request to the model route the incoming request to the model route the incoming request to the model that it thinks is best suited to satisfy that it thinks is best suited to satisfy that it thinks is best suited to satisfy the given request. This could give you the given request. This could give you the given request. This could give you cost savings upwards of 50% and this is cost savings upwards of 50% and this is cost savings upwards of 50% and this is something that I see becoming a lot more something that I see becoming a lot more something that I see becoming a lot more important. So, if you want to get important. So, if you want to get important. So, if you want to get started, go ahead and install the started, go ahead and install the started, go ahead and install the Microsoft Foundry toolkit in VS Code, Microsoft Foundry toolkit in VS Code, Microsoft Foundry toolkit in VS Code, create your first Foundry project, and create your first Foundry project, and create your first Foundry project, and deploy an AI model that you can use from deploy an AI model that you can use from deploy an AI model that you can use from your C# applications.

Summary

This tech transcript details how .NET developers can practically integrate AI into their applications by building a pull request review agent using Microsoft Foundry. It highlights the use of Foundry's extensive model access, specifically GPT-5.4 mini, and its VS Code extension for seamless development. The key takeaway is that this integration allows agents to leverage tools like the GitHub MCP to read pull requests and generate reviews, with the user responsible for observability and governance when running the agent loop in their own code.

View original episode ↗