LoopAI-103
Read this lesson

The plan

In this lab, you'll build an IT support agent for Wrenfield, first in the Foundry portal, then from VS Code and a small Python app. It takes about forty-five minutes. You'll need an Azure subscription with enough quota, VS Code, Git, and Python 3.13; version 3.14 isn't supported yet. Start in the new Foundry experience: select Start building and create a project, such as it-support-agent-project. Under advanced options, name the Foundry resource and pick a region, subscription, and resource group. Models have quotas per region, so if you hit a limit later, a different region may help. Then create an agent called it-support-agent. Its playground opens with a deployed model already selected.

Two kinds of files

Next, paste in the instructions: a professional IT support agent that uses the policy documents, admits when it doesn't know, and collects every detail before creating a ticket. Now add two tools, File search and Code interpreter, and give each its own file. This is the part to get right. The IT policy file goes to File search, through Upload files. It's grounding data: a handbook the agent looks things up in, indexed so answers come from your policy rather than from guesswork. The system performance CSV goes to Code interpreter, through its own Files button. That's data the agent calculates with: it writes Python in its sandbox to find trends and draw charts. Handbook for reading, logbook for number crunching. Save the agent, then test both paths. Ask about the password reset policy, or how to request new software, and the answer should come from the handbook. Ask for concerning trends in the performance data, or a chart of CPU usage over time, and Code interpreter does the analysis.

VS Code and your own app

Now switch to VS Code and install the Foundry Toolkit extension; some screens still call it the AI Toolkit. Set your default project, expand Prompt Agents, and open it-support-agent in the Agent Builder. Its playground works right inside the editor, so ask about reporting a lost or stolen device. Then clone the lab repository with Git Clone and open the Python folder. The app, agent with functions dot py, works in a few clear steps. It connects to your project with its endpoint and your Azure sign-in, then gets an OpenAI client. It fetches your agent by name, so the app reuses everything you set up in the portal. It creates a conversation, which keeps the history on the service side, so follow-up questions have context. For each message, it adds it to the conversation and calls the Responses API with an agent reference, which means: answer as this agent, with its instructions and tools. And when Code interpreter draws a chart, that file lives in the sandbox, so the app downloads it into an agent outputs folder. To run it, copy the dot env example to dot env, and paste your project endpoint, using Copy Endpoint in the toolkit. Create a virtual environment, install the requirements, sign in with az login, and run the script. Test the policy questions, spikes over eighty percent CPU, a memory chart, disk statistics, and a CPU and memory correlation, then type exit. Finally, delete the project, or the whole resource group, to avoid charges. Try it here in the simulation, or follow Microsoft's instructions with your own subscription.

Facts from Microsoft's documentation: What is Microsoft Foundry Agent Service?; Microsoft Foundry Toolkit for Visual Studio Code overview (CC BY 4.0), rewritten in Loop's own words and examples. Narration, animation, and quiz by Loop. The coding lab is based on Microsoft's lab files for the agent exercises (MicrosoftLearning/mslearn-ai-agents, MIT License; notice). Microsoft, Azure, and Microsoft Foundry are trademarks of Microsoft. Loop is independent and not affiliated with or endorsed by Microsoft.