Posted in

[Build and Deploy AI Agent in VS Code]

Walkthrough of building, testing, and deploying a hosted AI agent with AI Toolkit in VS Code and Microsoft Foundry, covering model selection, Agent Builder prototyping, scaffolded production code, local debugging, cloud deployment, and Foundry-based evaluation, safety, and monitoring.

New tooling allows AI engineers to move from prototype to hosted agents using AI Toolkit and Microsoft Foundry. This workflow adds model selection, prototyping, testing, and production deployment in a single pipeline.

Main feature/change and impact

The AI Toolkit integrates with Visual Studio Code and Microsoft Foundry to enable end-to-end agent lifecycle management. Developers can compare models with Copilot, deploy selected models to Foundry, and scaffold production-ready agent code. This reduces handoffs between experimentation and operations, and enforces repeatable decisions for model choice, tools configuration, and deployment artifacts.

Practical implications

Teams gain a reproducible path from UI prototypes to hosted agents with built-in evaluation and safety controls. The Agent Builder exports a template including agent code, YAML definitions, and container files. Local debugging, test prompts, and LLM-based judges enable predeployment validation. Foundry adds monitoring, red teaming, and continuous evaluation to maintain agent quality and cost controls in production.
“The goal is to show not just how to build an agent, but how to do it in a way that’s scalable, testable, and production ready.”
The workflow changes operational practices by emphasizing evaluation, traceability, and observability from day one. Next steps for teams are to adopt the model catalog, instrument evaluation runs, and automate deployment pipelines. Continuous monitoring and red teaming should be part of the release process to sustain safety and performance.

Key points from the article:

  • Use AI Toolkit and Copilot to make model selection transparent and repeatable.
  • Agent Builder UI configures identity, tools, and data sources for grounded responses.
  • Export UI prototype to scaffolded production code with Python or C# options.
  • Validate tool-calling flows locally before deploying to Microsoft Foundry.
  • Foundry provides continuous evaluation, red teaming, monitoring, and safety features.
  • Related Coverage:

    From the Microsoft Developer Community Blog articles