Microsoft Agent Framework: Ollama to Foundry deployment

Follow a Python agent from local Ollama tool calls to Microsoft Foundry hosting, with retrieval, deployment, tracing and workflow examples.

Player not loading? Watch on YouTube

The presenter builds Python agents with Microsoft Agent Framework, starting with Ollama running Qwen 3.5 4B locally. An enrollment question triggers a decorated Python function, then the model uses its response to answer. Later examples keep the agent code local while calling hosted Foundry models and tools, before deploying the agent itself to Azure.

Setup covers selective packages and a UV lock file. Some Foundry packages have alpha versions. Foundry IQ supplies knowledge retrieval over MCP; a toolbox adds Bing-powered web search and configures Code Interpreter. The benefits examples combine internal retrieval with enrollment data or web results. Code Interpreter execution is not demonstrated.

Hosting wraps the agent in a Responses API server and packages it with Docker. Azure Developer CLI deploys it, while OpenTelemetry exports traces to Application Insights. A writer-and-formatter workflow uses the same hosting approach.

Parts of the walkthrough use earlier runs and screenshots because Azure account and portal problems interrupt live navigation. Hosted agents are in public preview, with bugs, workarounds and limited regional availability. The presenter notices that the sample's region configuration disagrees with the documentation. Foundry memory remains an untested follow-up.