agent-framework-azure-ai-py
Build Azure AI Foundry agents using the Microsoft Agent Framework Python SDK (agent-framework-azure-ai).
Skill by Microsoft
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/jspoelstra-agent-framework-azure-ai-py
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: cloud, agent-building
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions: not checked yet.
What's inside
- Skill name
agent-framework-azure-ai-py- Description
- Build Azure AI Foundry agents using the Microsoft Agent Framework Python SDK (agent-framework-azure-ai). Use when creating persistent agents with AzureAIAgentsProvider, using hosted tools (code interpreter, file search, web search), integrating MCP servers, managing conversation threads, or implementing streaming responses. Covers function tools, structured outputs, and multi-tool agents.
- License
- MIT
- Metadata
- author: Microsoft · package: agent-framework-azure-ai · version: 1.0.0
- Instructions
- 350 lines in SKILL.md · view on GitHub
Files (5)
- SKILL.md
- advanced.md · references/
- mcp.md · references/
- threads.md · references/
- tools.md · references/
SKILL.md (first lines)
# Agent Framework Azure Hosted Agents
Build persistent agents on Azure AI Foundry using the Microsoft Agent Framework Python SDK.
## Architecture
```
User Query → AzureAIAgentsProvider → Azure AI Agent Service (Persistent)
↓
Agent.run() / Agent.run_stream()
↓
Tools: Functions | Hosted (Code/Search/Web) | MCP
↓
AgentThread (conversation persistence)
```
## Installation
```bash
# Full framework (recommended)
pip install agent-framework --pre
# Or Azure-specific package only
pip install agent-framework-azure-ai --pre
```
## Environment Variables
```bash
export AZURE_AI_PROJECT_ENDPOINT="https://<project>.services.ai.azure.com/api/projects/<project-id>" # Required for all auth methods
export AZURE_AI_MODEL_DEPLOYMENT_NAME="gpt-4o-mini" # Required for all auth methods
export BING_CONNECTION_ID="your-bing-connection-id" # For web search
export AZURE_TOKEN_CREDENTIALS=prod # Required only if DefaultAzureCredential is used in production
```
## Authentication & Lifecycle
> **🔑 Two rules apply to every code sample below:**
>
> 1. **Prefer `DefaultAzureCredential`.** It works locally (Azure CLI / VS Code / Developer CLI) and in Azure (managed identity, workload identity) with no code change. Avoid connection strings, account/API keys — they bypass Entra audit and rotation.
> - Local dev: `DefaultAzureCredential` works as-is.
> - Production: set `AZURE_TOKEN_CREDENTIALS=prod` (or `AZURE_TOKEN_CREDENTIALS=<specific_credential>`) to constrain the credential chain to production-safe credentials.
> 2. **Wrap every client in a context manager** so HTTP transports, sockets, and token caches are released deterministically:
> - Sync: `with <Client>(...) as client:`
> - Async: `async with <Client>(...) as client:` **and** `async with DefaultAzureCredential() as credential:` (from `azure.identity.aio`)
>
> Snippets may abbreviate this setup, but production code should always follow both rules.
```python
from azure.identity.aio import AzureCliCredential, DefaultAzureCredential, ManagedIdentityCredential
# Development
credential = AzureCliCredential()
# Production
# Local dev: DefaultAzureCredential. Production: set AZURE_TOKEN_CREDENTIALS=prod or AZURE_TOKEN_CREDENTIALS=<specific_credential>
credential = DefaultAzureCredential(require_envvar=True)
# Or use a specific credential directly in production:
# See https://learn.microsoft.com/python/api/overview/azure/identity-readme?view=azure-python#credential-classes
# credential = ManagedIdentityCredential()
```
## Core Workflow
### Basic Agent
```python
import asyncio
from agent_framework.azure import AzureAIAgentsProvider
from azure.identity.aio import AzureCliCredential
async def main():
async with (
AzureCliCredential() as credential,
AzureAIAgentsProvider(credential=credential) as provider,
):
agent = await provider.create_agent(
name="MyAgent",
instructions="You are a helpful assistant.",
)
result = await agent.run("Hello!")
print(result.text)
asyncio.run(main())
```
### Agent with Function Tools
```python
from typing import Annotated
from pydantic import Field
from agent_framework.azure import AzureAIAgentsProvider
from azure.identity.aio import AzureCliCredential
def get_weather(
location: Annotated[str, Field(description="City name to get weather for")],
) -> str:
"""Get the current weather for a location."""
return f"Weather in {location}: 72°F, sunny"
def get_current_time() -> str:
"""Get the current UTC time."""
from datetime import datetime, timezone
return datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M:%S UTC")
async def main():
async with (
AzureCliCredential() as credential,
AzureAIAgentsProvider(credential=credential) as provider,
):
agent = await provider.create_agent(
name="WeatherAgent",
instructions="You help with weather and time queries.",
tools=[get_weather, get_current_time], # Pass functions directly
)
result = await agent.run("What's the weather in Seattle?")
print(result.text)From jspoelstra/foundry-hosted-agents, MIT.
More from jspoelstra/foundry-hosted-agents
- 0.474score
seattle-activities
jspoelstra
Suggest Seattle activities by neighborhood and vibe.
SkillCFreshness: CClaude Code +9 - 0.471score
azure-kubernetes
jspoelstra
Production guidance for Azure Kubernetes Service (AKS).
SkillCFreshness: CClaude Code +9 - 0.471score
azure-prepare
jspoelstra
Analyze requirements and generate modern Azure infrastructure using Bicep (preferred), azure.yaml, Dockerfiles, and deployment plans.
SkillCFreshness: CClaude Code +9 - 0.471score
cloud-solution-architect
jspoelstra
Act as a Cloud Solution Architect for Azure.
SkillCFreshness: CClaude Code +9 - 0.470score
microsoft-foundry
Microsoft (curated)
Deploy, evaluate, fine-tune, and manage Foundry agents end-to-end: Docker build, ACR push, hosted/prompt agent create, container start, batch eval, continuous…
SkillCFreshness: CClaude Code +9 - 0.467score
foundry-hosted-agents
Microsoft (curated)
Build, deploy, and manage Microsoft AI Foundry hosted agents (containerized agents using Microsoft Agent Framework, LangGraph, or custom code).
SkillCFreshness: CClaude Code +9 - 0.467score
foundry-models
Microsoft (curated)
Discover, deploy, and manage models on Microsoft AI Foundry.
SkillCFreshness: CClaude Code +9 - 0.467score
foundry-observability
Microsoft (curated)
Trace, monitor, evaluate, and continuously improve Microsoft AI Foundry agents.
SkillCFreshness: CClaude Code +9 - 0.466score
karpathy-principles
jspoelstra
Karpathy-inspired coding discipline.
SkillCFreshness: CClaude Code +9 - 0.445score
frontend-design
jspoelstra
Create distinctive, production-grade frontend interfaces with high design quality.
SkillCFreshness: CClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Jul 15, 2026 (3 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- Version
- 1.0.0
- License
- MIT
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
- 0.542score
agent-framework-azure-ai-py
MicrosoftOfficial
Build Azure AI Foundry agents using the Microsoft Agent Framework Python SDK (agent-framework-azure-ai).
SkillCFreshness: C★ 3.1KClaude Code +9 - 0.275score
agent-framework-azure-ai-py
alexander-kastil
Build Azure AI Foundry agents using the Microsoft Agent Framework Python SDK (agent-framework-azure-ai).
SkillDFreshness: D★ 19Claude Code +9 - 0.268score
agent-framework-azure-ai-py
jiho00seo-dev
Build Azure AI Foundry agents using the Microsoft Agent Framework Python SDK (agent-framework-azure-ai).
SkillDFreshness: D★ 10Claude Code +9 - 0.255score
agent-framework-azure-ai-py
Microsoft
Build Azure AI Foundry agents using the Microsoft Agent Framework Python SDK (agent-framework-azure-ai).
SkillAFreshness: A★ 1Claude Code +9 - 0.242score
agent-framework-azure-ai-py
maruf-sherikar
Build Azure AI Foundry agents using the Microsoft Agent Framework Python SDK (agent-framework-azure-ai).
SkillDFreshness: D★ 1Claude Code +9 - 0.241score
agent-framework-azure-ai-py
Microsoft
Build Azure AI Foundry agents using the Microsoft Agent Framework Python SDK (agent-framework-azure-ai).
SkillCFreshness: C★ 13Claude Code +9 - 0.231score
agent-framework-azure-ai-py
Elit3-X
Build Azure AI Foundry agents using the Microsoft Agent Framework Python SDK (agent-framework-azure-ai).
SkillDFreshness: DClaude Code +9 - 0.228score
agent-framework-azure-ai-py
FrancosCorporation
Build Azure AI Foundry agents using the Microsoft Agent Framework Python SDK (agent-framework-azure-ai).
SkillDFreshness: DClaude Code +9 - 0.225score
agent-framework-azure-ai-py
dedsfe
Build Azure AI Foundry agents using the Microsoft Agent Framework Python SDK (agent-framework-azure-ai).
SkillDFreshness: DClaude Code +9 - 0.225score
agent-framework-azure-ai-py
williamlimasilva
Build Azure AI Foundry agents using the Microsoft Agent Framework Python SDK (agent-framework-azure-ai).
SkillDFreshness: DClaude Code +9
More from Microsoft
- 0.643score
azure-kubernetes
MicrosoftOfficial
Plan, create, and configure production-ready Azure Kubernetes Service (AKS) clusters.
SkillAFreshness: A★ 3.1KClaude Code +9 - 0.643score
azure-prepare
MicrosoftOfficial
Prepare azd-based Azure projects for deployment: generates azure.yaml, infrastructure (Bicep/Terraform), and Dockerfiles for the Azure Developer CLI (azd)…
SkillAFreshness: A★ 3.1KClaude Code +9 - 0.643score
azure-app-onboard
MicrosoftOfficial
End-to-end orchestrator: from a business idea, app idea, or existing app to running Azure deployment with cost estimates and pre-deploy approval.
SkillAFreshness: A★ 3.1KClaude Code +9 - 0.643score
appinsights-instrumentation
MicrosoftOfficial
Guidance for instrumenting webapps with Azure Application Insights.
SkillAFreshness: A★ 3.1KClaude Code +9 - 0.643score
azure-compliance
MicrosoftOfficial
Run Azure compliance and security audits with azqr plus Key Vault expiration checks.
SkillAFreshness: A★ 3.1KClaude Code +9 - 0.643score
foundry-iq
MicrosoftOfficial
Foundry IQ knowledge bases.
SkillAFreshness: A★ 3.1KClaude Code +9
Cite this page
agent-framework-azure-ai-py skill. Agent Mart. https://agentmart.dev/skills/jspoelstra-agent-framework-azure-ai-py (last updated 2026-10-24)