<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/your-first-ai-agent-is-only-a-few-lines-of-python-away-fmyecto0k" -->

---
title: Your first AI agent is only a few lines of Python away
description: A hands-on walkthrough demonstrates building a simple AI agent using Microsoft Foundry and the Azure AI Projects Python library. The demo covers setting up...
canonical: https://daily.dev/posts/your-first-ai-agent-is-only-a-few-lines-of-python-away-fmyecto0k
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Your first AI agent is only a few lines of Python away | daily.dev
og:description: A hands-on walkthrough demonstrates building a simple AI agent using Microsoft Foundry and the Azure AI Projects Python library. The demo covers setting up...
og:url: https://daily.dev/posts/your-first-ai-agent-is-only-a-few-lines-of-python-away-fmyecto0k
og:image: https://api.daily.dev/og/posts/fMYEctO0K.png
og:image:alt: Your first AI agent is only a few lines of Python away
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Your first AI agent is only a few lines of Python away

**[Microsoft Developer](https://daily.dev/sources/microsoftdeveloper)** · 4 min read · 0 upvotes · 0 comments

## Summary

A hands-on walkthrough demonstrates building a simple AI agent using Microsoft Foundry and the Azure AI Projects Python library. The demo covers setting up Azure resources via CLI, deploying a model, creating a prompt agent with instructions, and adding an MCP tool that connects to a demo 'cupcake store' to place an order. The narrator shows the agent evolving from a basic chatbot with no data access to one that can handle a conversational ordering flow with customer ID lookup and order placement.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=pdBSgV2SRcM>

## Questions this post answers

### How do I create a basic AI agent using Microsoft Foundry and Python?

Set up an Azure resource group and Foundry project via Azure CLI, deploy a model, then install the Azure AI Projects Python library. Create an agent.py file importing azure-ai-projects and azure-ai-identity, add your project endpoint, and define a prompt agent with a name, model, and instructions. Add MCP tools to give the agent real functionality beyond plain model calls.

_daily.dev surfaces practical walkthroughs like this for developers wiring up their first AI agent._

## Similar posts on daily.dev

- [From code to cloud: Deploy an AI agent to Microsoft Foundry in minutes with azd](https://daily.dev/posts/from-code-to-cloud-deploy-an-ai-agent-to-microsoft-foundry-in-minutes-with-azd-68bdbsc0i) · DevBlogs · 1 upvotes · 0 comments

---

Tags: [#python](https://daily.dev/tags/python), [#ai-agents](https://daily.dev/tags/ai-agents), [#azure](https://daily.dev/tags/azure), [#mcp](https://daily.dev/tags/mcp)

[View this post on daily.dev](https://daily.dev/posts/your-first-ai-agent-is-only-a-few-lines-of-python-away-fmyecto0k)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Your first AI agent is only a few lines of Python away","url":"https://daily.dev/posts/your-first-ai-agent-is-only-a-few-lines-of-python-away-fmyecto0k","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/your-first-ai-agent-is-only-a-few-lines-of-python-away-fmyecto0k"},"datePublished":"2026-09-01T22:35:44.673Z","dateModified":"2026-09-01T22:36:35.346Z","description":"A hands-on walkthrough demonstrates building a simple AI agent using Microsoft Foundry and the Azure AI Projects Python library. The demo covers setting up...","image":"https://i.ytimg.com/vi/pdBSgV2SRcM/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/pdBSgV2SRcM/sddefault.jpg","isAccessibleForFree":true,"articleSection":"Microsoft Developer","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Microsoft Developer","logo":"https://media.daily.dev/image/upload/s--xZzU3zUq--/f_auto/v1746714872/logos/microsoftdeveloper","url":"https://daily.dev/sources/microsoftdeveloper"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/your-first-ai-agent-is-only-a-few-lines-of-python-away-fmyecto0k","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"python,ai-agents,azure,mcp","timeRequired":"PT4M","video":{"@type":"VideoObject","name":"Your first AI agent is only a few lines of Python away","description":"A hands-on walkthrough demonstrates building a simple AI agent using Microsoft Foundry and the Azure AI Projects Python library. The demo covers setting up...","thumbnailUrl":"https://i.ytimg.com/vi/pdBSgV2SRcM/sddefault.jpg","uploadDate":"2026-09-01T22:35:44.673Z","duration":"PT4M","url":"https://api.daily.dev/r/fMYEctO0K","embedUrl":"https://www.youtube.com/embed/pdBSgV2SRcM"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Microsoft Developer","item":"https://daily.dev/sources/microsoftdeveloper"},{"@type":"ListItem","position":3,"name":"Your first AI agent is only a few lines of Python away"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/your-first-ai-agent-is-only-a-few-lines-of-python-away-fmyecto0k#faq","mainEntity":[{"@type":"Question","name":"How do I create a basic AI agent using Microsoft Foundry and Python?","acceptedAnswer":{"@type":"Answer","text":"Set up an Azure resource group and Foundry project via Azure CLI, deploy a model, then install the Azure AI Projects Python library. Create an agent.py file importing azure-ai-projects and azure-ai-identity, add your project endpoint, and define a prompt agent with a name, model, and instructions. Add MCP tools to give the agent real functionality beyond plain model calls. daily.dev surfaces practical walkthroughs like this for developers wiring up their first AI agent."}}]}
```

