Skip to content
mikokono
Go back

DeployAgent Evolution: Supporting Both Classic and Modern Azure AI Foundry Agents

Repository: nampacx/Microsoft-Foundry-Agent-Deployment

What’s New

If you’ve been following my work with DeployAgent, you know it started as a tool to automate the deployment of Azure AI Foundry agents using YAML configuration files. When I first built it, I focused on the classic Azure AI Foundry portal because that’s where the immediate need was.

But the Azure AI ecosystem never stands still. Microsoft has been evolving Foundry, and with that evolution comes a new generation of agents—what I’m calling the “modern” Foundry agents. The latest update to DeployAgent brings support for both classic and modern Foundry agents in a single, refactored codebase.

Dual Agent Support

DeployAgent now supports both agent generations:

Both deployment modes are available from the same tool, allowing flexibility based on your project requirements.

Connected Agents

Connected agents (agents using other agents as tools) are no longer supported in modern Foundry deployments. This feature remains available in classic mode for backward compatibility. Modern deployments require alternative orchestration patterns, which I plan to cover in the future.

Project Restructure

The codebase has been refactored with a modular architecture:

Separation of Concerns: Distinct modules for classic and modern agent handling with shared utilities for YAML parsing, authentication, and configuration management.

Shared Infrastructure: Centralized authentication, error handling, logging, and validation logic benefits both deployment modes.

Extensibility: New features can be added without modifying core deployment logic.

Testability: Modular design enables isolated component testing.

This restructure reduces code duplication, simplifies maintenance, and makes the codebase easier to extend with new Foundry capabilities.

Usage

Existing users: YAML configurations remain backward-compatible.

New users: Choose deployment mode based on requirements:

Configuration

The tool supports both YAML formats:

The tool handles API contract differences automatically.

Deployment

The CLI supports the following arguments:

ArgumentShortRequiredDescription
<yaml-file>-Path to your agent definition YAML
--project-endpoint-pYour Azure AI Foundry project endpoint
--sdk-version-vv1 or v2 (default: v1)
--tenant-id-tYour Azure tenant ID (optional)

Use the --sdk-version flag to specify which agent generation to deploy:

# Classic agents (v1 SDK - default)
dotnet run -- agents.yaml --project-endpoint <endpoint>

# Modern agents (v2 SDK)
dotnet run -- agents.yaml --project-endpoint <endpoint> --sdk-version v2

Technical Details

For those interested in the architectural decisions, here’s what the refactoring achieved:

Shared Abstractions

Common interfaces for agent deployment, regardless of type:

public interface IAgentDeployer
{
    Task<DeploymentResult> DeployAgentAsync(AgentConfiguration config);
    Task<ValidationResult> ValidateConfigurationAsync(AgentConfiguration config);
}

Classic and modern deployers implement this interface, allowing the CLI to work with either transparently.

Configuration Parsing

YAML parsing now uses a two-stage approach:

  1. Load and validate the base YAML structure
  2. Transform to the appropriate internal model based on deployment mode

This means you can validate your YAML file’s structure before even attempting authentication or deployment.

Error Handling

Improved error messages now specify whether an issue is mode-specific (“Connected agents are not supported in modern deployments”) or general (“Invalid OpenAPI specification URL”).

Future Plans

Potential additions:

Summary

DeployAgent now supports both classic and modern Azure AI Foundry agents with a restructured, modular codebase. Existing configurations remain backward-compatible while new deployments can target either mode.

The project is open source. Feedback and contributions are welcome.


Related Posts:


Share this post on:

Previous Post
Making Document Intelligence Beautiful: Cleaning OCR Noise for Power Automate
Next Post
EventCreator: Simple Calendar Event Management