LoopAI-103

Build your first agent in Microsoft Foundry

Unit 4 of 10 · Module 7: Develop AI agents with Microsoft Foundry and Visual Studio Code

Before you start

Short explainers for ideas this lesson builds on. Watch these first if they're new to you.

0 of 2 watched · about 4 min
Read this lesson

Create the agent

Building your first agent in the Foundry portal is an accessible way into agent development: a visual interface guides you through configuration, without code. Open the Foundry portal at AI dot azure dot com, and sign in with your Azure account. Select your project, or create a new one. In the left menu, select Build, then Agents, and select Create. Now enter the agent's details: a descriptive name, a clear description of its purpose, and a model. Here's a subtle point. A model is a type of AI brain, like gpt-4.1. A deployment is your own running copy of that model, inside your project, with a name your agent can call. So you either pick a model you've already deployed, or deploy a new one right from the dropdown. The portal then creates the agent, and opens its configuration.

Instructions and parameters

Instructions are the foundation of an agent's behavior. Think of them as a job description the agent reads before every conversation: who it is, how it should respond to users, and what to do in different situations. Clear, specific instructions lead to consistent, reliable behavior; vague ones lead to guesswork. You can also tune two model parameters, and they're easy to mix up. When a model writes, it picks the next word from a list of possible words, each with a probability. Temperature controls how adventurous that pick is. Low temperature almost always takes the most likely word, so answers are focused and repeatable. High temperature takes more chances, so answers are more varied and creative. Top p controls how many words are even in the running. At a top p of 0.9, the model only considers the most likely words that together make up ninety percent of the probability, and ignores the long tail. Change one of them at a time, not both.

Test, add tools, deploy

Before it goes live, try the agent out: open the Playground tab and start chatting with it. The playground keeps the conversation history during your session. That's what multi-turn means: each new message is answered with the earlier ones in mind, so you can check the agent keeps context, like remembering your name from three messages ago. Next, add tools, from the agent's Tools section, or under Build, Tools. There are three categories. Configured tools are built in and ready to use, like code interpreter and file search. Catalog tools you pick from a registry, such as Bing web search, Azure AI Search, SharePoint, or an MCP server. MCP, the Model Context Protocol, is an open standard plug that lets an agent connect to tools and data from other systems. And custom tools are your own, often added through an OpenAPI specification: a machine-readable description of an API's endpoints, inputs, and outputs, so the agent knows exactly how to call it. When you're happy, save the agent, and each save becomes a new version. The agent's details then show its name and its endpoint, the address your apps call. Your apps then call the agent through the Microsoft Foundry SDK, a ready-made library for languages like Python and C sharp, or through REST APIs, plain web requests that any language can send.

Facts from Microsoft's documentation: What is Microsoft Foundry Agent Service? (CC BY 4.0), rewritten in Loop's own words and examples. Narration, animation, and quiz by Loop. Microsoft, Azure, and Microsoft Foundry are trademarks of Microsoft. Loop is independent and not affiliated with or endorsed by Microsoft.