Hosted AI Agents Made Easy: Build, Test, Deploy

The video showcases how to build, test, and deploy a custom AI agent for social media management using GitHub Copilot CLI and Microsoft Foundry, emphasizing control over business logic, source control, and hosted deployment. It highlights the seamless integration of tools like the Foundry toolkit, Agent Inspector, and Azure infrastructure to create, debug, and scale a robust, interactive AI assistant running as a hosted service.

The video demonstrates how to build, test, and deploy a coded AI agent tailored for a social media management team using GitHub Copilot CLI and Microsoft Foundry. While low-code agents offer quick validation, many teams require more control for custom business logic, source control, automated setup, and hosted deployment. The example agent supports developer-focused content creation for social media campaigns and is designed to run as a hosted agent within Microsoft Foundry. The process begins by initializing the project in Visual Studio Code using GitHub Copilot CLI, which leverages the Microsoft Foundry skill to generate a project structure, configuration files, and implementation aligned with Foundry’s agent development workflow.

The agent is configured to use a Foundry toolbox containing two retrieval tools: the Microsoft Learn MCP server for official documentation and a web search tool for accessing fresh data. Copilot generates the core logic in a main.py file, which integrates the Microsoft agent framework, authenticates requests, and serves responses over the OpenAI protocol. Configuration files such as agent.yaml, toolbox.yaml, and azure.yaml define the agent’s behavior, tools, hosting environment, and deployment infrastructure, including Azure Bicep templates for provisioning resources like container registries and monitoring.

Testing the agent can be done locally via the terminal using the Azure Developer CLI, which installs dependencies and runs the agent as an HTTP server. The agent responds to prompts with clarifying questions and campaign suggestions, demonstrating its interactive capabilities. Additionally, the Foundry toolkit’s Agent Inspector UI provides a visual interface for interacting with the agent, inspecting output metadata, event traces, tool calls, and streaming responses. GitHub Copilot assists in configuring the project to work seamlessly with the Agent Inspector by setting up debugging configurations and resolving dependencies.

Once the agent is fully tested and customized, deployment is straightforward through the Foundry toolkit UI. The agent is containerized using a Docker image and deployed to Azure Container Registry managed by Foundry. After deployment, the hosted agent can be monitored and interacted with via the Microsoft Foundry project portal, allowing teams to test and validate the agent’s behavior in a cloud environment. This deployment approach ensures scalability and accessibility for production use.

Overall, the workflow showcased in the video highlights the synergy between GitHub Copilot CLI, Microsoft Foundry skill, Foundry toolkit, and Microsoft agent framework for developing sophisticated AI agents. The integration of tools like the Agent Inspector and tracing capabilities enhances transparency and debugging, enabling developers to treat the agent as an inspectable system rather than a black box. For the social media management team, this results in a robust, source-controlled AI assistant capable of generating targeted developer content and running reliably as a hosted service in Microsoft Foundry.