tldw.ink
…
← Back to tldw.ink

Build Your First AI Agent with Microsoft Agent Framework

Azure Innovation Station | Azure AI Agents

Frankie builds a Microsoft agent framework agent and hosts it in Microsoft Foundry

Frankie builds a bakery agent in Python with the Microsoft agent framework, tests it locally, then deploys it as a Microsoft Foundry Hosted Agent. The example has two tools: search menu, which searches Frankie's Bakery products, and get order status, which looks up an order by ID. Function annotations describe each tool and its parameters so the agent can decide when and how to call them. DefaultAzureCredential authenticates to Microsoft Foundry; the code names the agent, supplies instructions and tools, and connects it to a deployed model through a .env file containing the model deployment and project endpoint. Frankie shows a GPT 5.4 or mini model deployment in Microsoft Foundry at AI.azure.com, then creates a virtual environment and installs the Python requirements.

A verbose run makes the agent loop explicit: an initial inference request sends the instructions, user prompt and available tools to the Microsoft Foundry model. When the model requests search menu and get order status, the framework runs those functions and sends their outputs in a second inference request. With no further tool calls, the model returns the final answer. The local dev UI offers conversations, events, traces and tool-call inspection; an order-status query for 1002 demonstrates that debugging view.

Frankie distinguishes a Microsoft Foundry Hosted Agent from a Microsoft Foundry prompt agent. In the hosted approach, the Microsoft agent framework runs the instructions, tools, middleware and agent loop inside a container; Microsoft Foundry handles the model inference requests. A prompt agent instead keeps the loop, tools and knowledge in Microsoft Foundry, requiring less setup but offering less customization [inferred from architecture diagram reference].

For the hosted deployment, Frankie uses the Microsoft Foundry toolkit for VS code and its deploy hosted agent command. The demo selects code rather than a prebuilt container, remote dependency installation, and a Python main.py entry point. An Azure.yaml file supplies the Azure AI model deployment environment variable; the Foundry project endpoint is injected automatically. In Microsoft Foundry, Frankie verifies that the agent is running and uses playground logs and traces to confirm a get order status call for Order 1002. The portal's call agent section then supplies a starting point for connecting a backend and frontend.