This is a starter template to build a .NET-based agentic AI app using Microsoft Agent Framework and Microsoft Foundry with Aspire.
Building AI agents is getting easier. Deploying them as part of a real application, with multiple services, persistent state, and production infrastructure, is where things get complicated. But where should we start building architecture to deploy them onto the cloud in a cloud-native way?
This starter pack is where you should start from. It's an opinionated way to build an AI agent system using Microsoft Agent Framework and Microsoft Foundry with Aspire. If you're unsure where to start, this starter pack will guide you walk through.
This stater template provides the following features:
- Blazor frontend for chat UI
- ASP.NET backend with Microsoft Agent Framework
- Microsoft Foundry Hosted Agents for agent hosting
- To-do list management MCP server for tooling support to agent
- Aspire for cloud-native app orchestration
- Azure subscription (free)
- .NET 10 SDK or higher
- Visual Studio 2026 or VS Code + C# Dev Kit
- Docker Desktop or equivalent
- Azure Developer CLI
- Azure CLI
- Aspire CLI
This starter pack has a three-step deployment process, which mimicks the real-world scenario. MCP servers, agents and apps are usually deployed separately.
- Deploy an MCP server.
- Deploy a hosted agent to Microsoft Foundry.
- Deploy apps via Aspire.
-
Get the repository root.
# bash/zsh REPOSITORY_ROOT=$(git rev-parse --show-toplevel)
# PowerShell $REPOSITORY_ROOT = git rev-parse --show-toplevel
-
Login to Azure using
azd.azd auth login
-
Login to Azure using
az.az login
-
Navigate to the
resources-mcpdirectory.cd $REPOSITORY_ROOT/resources-mcp
-
Deploy a To-do MCP server.
azd up
While provisioning, you might be asked to enter environment name, Azure subscription and location.
NOTE: You may have to set the environment variable,
AZURE_TENANT_ID.# bash/zsh AZURE_TENANT_ID=$(az account show --query "tenantId" -o tsv)
# PowerShell $env:AZURE_TENANT_ID = az account show --query "tenantId" -o tsv
-
Navigate to the
resources-foundrydirectory.cd $REPOSITORY_ROOT/resources-foundry
-
Deploy a hosted agent to Microsoft Foundry.
azd up
While provisioning, you might be asked to enter environment name, Azure subscription and location.
NOTE: You may have to set the environment variable,
AZURE_TENANT_ID.# bash/zsh AZURE_TENANT_ID=$(az account show --query "tenantId" -o tsv)
# PowerShell $env:AZURE_TENANT_ID = az account show --query "tenantId" -o tsv
-
Make sure you're at the repository root.
cd $REPOSITORY_ROOT
-
Deploy the app.
azd up
While provisioning, you might be asked to enter environment name, Azure subscription and location.
-
Make sure you're at the repository root.
cd $REPOSITORY_ROOT
-
Run Aspire.
aspire run --project ./src/MafStarterPack.AppHost

