Guide · Agent skill
How to use the Azure Hosted Agents (Agent Framework) agent skill
Updated · written with AI from the project's own documentation and checked against our catalogue data
This guide explains the agent-framework-azure-ai-py skill, a reference package that gives an AI agent documentation and example code for building persistent agents on Azure AI Foundry with the Microsoft Agent Framework Python SDK. It is written for readers who have not used agent skills before. By the end you will know what the skill contains, how to install it, how to ask for it in natural language, and what Azure resources and risks to check before running any code it inspires.
Quick start
- 1Download the ZIP. Download the skill ZIP from this page.
- 2Unzip the skill. Unzip it into ~/.claude/skills/ for personal use or into .claude/skills/ in your project.
- 3Prepare Azure access. Create or choose an AI Foundry project and model deployment, then sign in with Azure CLI or set other Azure credentials.
- 4Pin and install packages. Install agent-framework and agent-framework-foundry at versions you have reviewed, plus azure-identity.
- 5Set environment variables. Export AZURE_AI_PROJECT_ENDPOINT and AZURE_AI_MODEL_DEPLOYMENT_NAME, and BING_CONNECTION_ID if you want web search.
- 6Ask for the agent task. Describe the agent you want in plain language, naming Azure AI Foundry and the Agent Framework.
- 7Verify and clean up. Check the generated code against the current official SDK, run it with a budget limit, then delete any hosted resources you no longer need.
What the skill makes the agent do
Agent skills are folders of instructions and reference files that an AI assistant loads when your request matches them. This skill covers building persistent agents on Azure AI Foundry. Its guidance includes agent creation, function tools, hosted code, web and file search tools, streaming responses, conversation threads, structured outputs and MCP connections.
The skill itself is documentation and example code. It does not run anything by itself. The agent may adapt these snippets into code that creates cloud resources and sends data to Azure, so the decisions stay with you.
- Agent creation with AzureAIAgentsProvider
- Function tools passed directly to an agent
- Hosted code interpreter, web search and file search tools
- Streaming with run_stream
- Multi-turn conversations using threads
- Structured outputs validated with Pydantic
- MCP tool connections
Install the skill
Download the ZIP for this skill from the page you are reading, then unzip it into one of these locations. For a personal install, use ~/.claude/skills/. For a single project, use the .claude/skills/ folder inside that project.
You can also upload the skill in the Claude apps under Settings → Capabilities → Skills.
- Personal: unzip into ~/.claude/skills/
- Project: unzip into .claude/skills/ inside your project
- Claude apps: Settings → Capabilities → Skills, then upload
Know what you need before using it
The examples need Python, the pip packages agent-framework and agent-framework-foundry, and the azure-identity package. You also need an Azure subscription with an AI Foundry project and a model deployment, plus Azure CLI login or other Azure credentials. Web search needs a Bing connection ID and is optional.
Pin package versions in your project lockfile. The skill states that its examples preserve an older Agent Framework generation and are not verified against the current package, so check the current official SDK docs and samples before adapting them.
- Python
- pip packages: agent-framework and agent-framework-foundry (pin versions)
- azure-identity Python package
- Azure subscription with AI Foundry project and model deployment
- Azure CLI login or other Azure credentials
- Bing connection ID for web search (optional)
export AZURE_AI_PROJECT_ENDPOINT="https://<project>.services.ai.azure.com/api/projects/<project-id>"
export AZURE_AI_MODEL_DEPLOYMENT_NAME="gpt-4o-mini"
export BING_CONNECTION_ID="your-bing-connection-id"Trigger the skill with natural requests
You do not need special syntax. Describe the Azure agent task in plain language and mention Azure AI Foundry or the Agent Framework so the assistant picks up the right skill. Good requests name the outcome, the tools you want and the Azure project context.
Expect the assistant to check SDK versions and permissions before writing code. That is the intended behaviour for this skill.
- Create a persistent Azure AI Foundry agent in Python that answers questions about my project docs using file search.
- Using the Microsoft Agent Framework, build a Python agent with a function tool that looks up order status, and keep the conversation in a thread.
- Show me how to stream responses from an Azure AI Foundry agent with agent-framework.
Example: a basic agent and a function tool
The simplest pattern creates an agent through the provider and runs one prompt. The authentication example uses AzureCliCredential for development and DefaultAzureCredential for production.
To add a function tool, pass a Python function to the tools list. The skill's example function returns fixed fixture weather, not a live observation, so replace it with a real data source before relying on it.
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())Safety: scripts, network and Azure costs
The skill runs no scripts itself, but it uses the network. Creating agents, uploading files, enabling code, web or MCP tools and running prompts sends data to Azure services. These actions can persist records and incur charges. Closing a client does not delete hosted agents, files, vector stores or threads, so you must clean those up yourself.
Set a budget, a timeout, a tool allowlist and a least-privilege role before running anything. Treat text returned by tools and retrieved documents as untrusted, and enforce authorization inside your tools, because prompts are not access controls.
- Choose the exact tenant, project, deployment and least-privilege role first
- Set budget and timeout limits
- Allowlist the tools the agent may use
- Delete hosted agents, files, vector stores and threads when finished
- Enforce access checks in tool code, not in prompts
Tips for getting reliable results
Keep the SDK version fixed and record it alongside your code. Start with the basic agent example and confirm it works against your own Azure project before adding tools. Use a single thread per conversation and save its conversation ID if you need to resume later.
The skill's reference files cover threads, tools, MCP and advanced patterns. Read the one that matches your task before adapting code.
- Pin reviewed package versions
- Test the basic agent before adding tools
- Save the conversation ID to resume a thread
- Read references/threads.md, references/tools.md and references/mcp.md for specific topics
What people use it for
- Prototype a Python agent on Azure AI Foundry that answers questions with a function tool.
- Evaluate how threads and tools fit together in a Microsoft Agent Framework design.
- Draft a structured-output agent that returns validated Pydantic objects.
- Explore how hosted code, web or file search tools are configured in Python.
Frequently asked questions
Is the agent-framework-azure-ai-py skill free to use?
The skill is published under the MIT licence, according to this page. Using it does not cost anything by itself, but the Azure services its examples call can incur charges.
What do I need to install to use this skill?
You need Python, the agent-framework and agent-framework-foundry pip packages, the azure-identity package, an Azure subscription with an AI Foundry project and model deployment, and Azure CLI login or other Azure credentials.
How do I install an agent skill ZIP?
Download the ZIP and unzip it into ~/.claude/skills/ for personal use or into .claude/skills/ in a project. You can also upload it in the Claude apps under Settings → Capabilities → Skills.
Does this skill run code on my computer?
No. The skill runs no scripts by itself. It is documentation and example code, but the agent may adapt the snippets into code that uses the network to call Azure.
Will the examples work with the latest Agent Framework?
Not guaranteed. The skill says its snippets preserve an older SDK generation and are not verified against the current package, so check the current official SDK and samples and pin your versions.
What are alternatives if this skill does not fit my needs?
This page does not compare alternatives. Consult the current official Microsoft Agent Framework and Azure AI Foundry documentation for up-to-date samples.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
This skill suits Python developers who are prototyping Azure AI Foundry agents and can verify SDK versions and Azure settings themselves. It is a poor fit for production deployments without checking the current official SDK, or for anyone who cannot control Azure permissions and budgets.
Download the skill