A sample AI agent built with Microsoft Agent Framework that helps users find hotels in Seattle. This project is designed as an azd starter template for deploying hosted AI agents to Azure AI Foundry.
Important
Blog post: Azure Developer CLI (azd): Debug hosted AI agents from your terminal
Code has been updated 4/28/2026 so that it works with hosted agents (v1.0 release of Microsoft Agent Framework).
Make sure to deploy to a supported region (Region Availability).
The agent uses a simulated hotel database and a tool-calling pattern to:
- Accept natural-language requests about Seattle hotels
- Ask clarifying questions about dates and budget
- Call the
get_available_hotelstool to find matching options - Present results in a conversational format
- Python 3.12+
- Azure Developer CLI (azd) 1.23.7+
- An Azure subscription
- An Azure AI Foundry project with a deployed model (e.g.,
gpt-4.1-mini)
git clone https://github.com/puicchan/seattle-hotel-agent
cd seattle-hotel-agent
azd ai agent init
azd upDuring azd ai agent init, you'll be prompted to choose a model. You can:
- Deploy a new model — select
gpt-4.1-mini(or another supported model) - Connect to an existing model — make sure the deployment name matches
MODEL_DEPLOYMENT_NAMEin your.env(defaults togpt-4.1-mini) - Skip model setup — configure it manually later
Note: If you use a model deployment name other than
gpt-4.1-mini, updateMODEL_DEPLOYMENT_NAMEin your.envto match.
-
Copy
.env.sampleto.envand fill in your values:cp .env.sample .env
-
Install dependencies:
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate pip install -r requirements.txt
-
Run the agent:
python main.py
The agent server starts on
http://localhost:8088.
After deploying, use these commands to inspect and troubleshoot your hosted agent:
# View container status, health, and error details
azd ai agent show --name seattle-hotel-agent --version 1
# Fetch recent logs
azd ai agent monitor --name seattle-hotel-agent --version 1
# Stream logs in real time
azd ai agent monitor --name seattle-hotel-agent --version 1 -f
# View system-level logs
azd ai agent monitor --name seattle-hotel-agent --version 1 --type systemSee the blog post for more details.
| File | Description |
|---|---|
main.py |
Agent definition, hotel tool, and server entrypoint |
requirements.txt |
Python dependencies |
Dockerfile |
Container image for deployment |
.env.sample |
Template for required environment variables |
| Variable | Required | Description |
|---|---|---|
PROJECT_ENDPOINT |
Yes | Your Azure AI Foundry project endpoint (e.g., https://<project>.services.ai.azure.com) |
MODEL_DEPLOYMENT_NAME |
No | Model deployment name (default: gpt-4.1-mini) |
See CONTRIBUTING.md for guidelines.
This project is licensed under the MIT License. See LICENSE.md.