agent-framework-azure-ai-py
Agent Framework Azure Hosted Agents workflow skill. Use this skill when the user needs Build persistent agents on Azure AI Foundry using the Microsoft Agent Framework Python SDK and the operator should preserve the upstream workflow, copied support files, and provenance before merging or handing off
Install
mkdir -p .claude/skills/agent-framework-azure-ai-py-diegosouzapw && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/16392" && unzip -o skill.zip -d .claude/skills/agent-framework-azure-ai-py-diegosouzapw && rm skill.zipInstalls to .claude/skills/agent-framework-azure-ai-py-diegosouzapw
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Agent Framework Azure Hosted Agents workflow skill. Use this skill when the user needs Build persistent agents on Azure AI Foundry using the Microsoft Agent Framework Python SDK and the operator should preserve the upstream workflow, copied support files, and provenance before merging or handing off.About this skill
Agent Framework Azure Hosted Agents
Overview
This public intake copy packages plugins/antigravity-awesome-skills-claude/skills/agent-framework-azure-ai-py from https://github.com/sickn33/antigravity-awesome-skills into the native Omni Skills editorial shape without hiding its origin.
Use it when the operator needs the upstream workflow, support files, and repository context to stay intact while the public validator and private enhancer continue their normal downstream flow.
This intake keeps the copied upstream files intact and uses the external_source block in metadata.json plus ORIGIN.md as the provenance anchor for review.
Agent Framework Azure Hosted Agents Build persistent agents on Azure AI Foundry using the Microsoft Agent Framework Python SDK.
Imported source sections that did not map cleanly to the public headings are still preserved below or in the support files. Notable imported sections: Architecture, Environment Variables, Authentication, Provider Methods, Conventions, Limitations.
When to Use This Skill
Use this section as the trigger filter. It should make the activation boundary explicit before the operator loads files, runs commands, or opens a pull request.
- This skill is applicable to execute the workflow or actions described in the overview.
- Use when the request clearly matches the imported source intent: Build persistent agents on Azure AI Foundry using the Microsoft Agent Framework Python SDK.
- Use when the operator should preserve upstream workflow detail instead of rewriting the process from scratch.
- Use when provenance needs to stay visible in the answer, PR, or review packet.
- Use when copied upstream references, examples, or scripts materially improve the answer.
- Use when the workflow should remain reviewable in the public intake repo before the private enhancer takes over.
Operating Table
| Situation | Start here | Why it matters |
|---|---|---|
| First-time use | metadata.json | Confirms repository, branch, commit, and imported path through the external_source block before touching the copied workflow |
| Provenance review | ORIGIN.md | Gives reviewers a plain-language audit trail for the imported source |
| Workflow execution | SKILL.md | Starts with the smallest copied file that materially changes execution |
| Supporting context | SKILL.md | Adds the next most relevant copied source file without loading the entire package |
| Handoff decision | ## Related Skills | Helps the operator switch to a stronger native skill when the task drifts |
Workflow
This workflow is intentionally editorial and operational at the same time. It keeps the imported source useful to the operator while still satisfying the public intake standards that feed the downstream enhancer flow.
- bash # Full framework (recommended) pip install agent-framework --pre # Or Azure-specific package only pip install agent-framework-azure-ai --pre ### Basic Agent python import asyncio from agentframework.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.createagent( 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 agentframework.azure import AzureAIAgentsProvider from azure.identity.aio import AzureCliCredential def getweather( 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 getcurrenttime() -> 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.createagent( name="WeatherAgent", instructions="You help with weather and time queries.", tools=[getweather, getcurrenttime], # Pass functions directly ) result = await agent.run("What's the weather in Seattle?") print(result.text) ### Agent with Hosted Tools python from agentframework import ( HostedCodeInterpreterTool, HostedFileSearchTool, HostedWebSearchTool, ) from agentframework.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.createagent( name="MultiToolAgent", instructions="You can execute code, search files, and search the web.", tools=[ HostedCodeInterpreterTool(), HostedWebSearchTool(name="Bing"), ], ) result = await agent.run("Calculate the factorial of 20 in Python") print(result.text) ### Streaming Responses python async def main(): async with ( AzureCliCredential() as credential, AzureAIAgentsProvider(credential=credential) as provider, ): agent = await provider.createagent( name="StreamingAgent", instructions="You are a helpful assistant.", ) print("Agent: ", end="", flush=True) async for chunk in agent.runstream("Tell me a short story"): if chunk.text: print(chunk.text, end="", flush=True) print() ### Conversation Threads python from agentframework.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.createagent( name="ChatAgent", instructions="You are a helpful assistant.", tools=[getweather], ) # Create thread for conversation persistence thread = agent.getnewthread() # First turn result1 = await agent.run("What's the weather in Seattle?", thread=thread) print(f"Agent: {result1.text}") # Second turn - context is maintained result2 = await agent.run("What about Portland?", thread=thread) print(f"Agent: {result2.text}") # Save thread ID for later resumption print(f"Conversation ID: {thread.conversationid}") ### Structured Outputs python from pydantic import BaseModel, ConfigDict from agentframework.azure import AzureAIAgentsProvider from azure.identity.aio import AzureCliCredential class WeatherResponse(BaseModel): modelconfig = ConfigDict(extra="forbid") location: str temperature: float unit: str conditions: str async def main(): async with ( AzureCliCredential() as credential, AzureAIAgentsProvider(credential=credential) as provider, ): agent = await provider.createagent( name="StructuredAgent", instructions="Provide weather information in structured format.", responseformat=WeatherResponse, ) result = await agent.run("Weather in Seattle?") weather = WeatherResponse.modelvalidate_json(result.text) print(f"{weather.location}: {weather.temperature}°{weather.unit}")
- Confirm the user goal, the scope of the imported workflow, and whether this skill is still the right router for the task.
- Read the overview and provenance files before loading any copied upstream support files.
- Load only the references, examples, prompts, or scripts that materially change the outcome for the current request.
- Execute the upstream workflow while keeping provenance and source boundaries explicit in the working notes.
- Validate the result against the upstream expectations and the evidence you can point to in the copied files.
- Escalate or hand off to a related skill when the work moves out of this imported workflow's center of gravity.
Imported Workflow Notes
Imported: Installation
# Full framework (recommended)
pip install agent-framework --pre
# Or Azure-specific package only
pip install agent-framework-azure-ai --pre
Imported: Core Workflow
Basic Agent
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
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)
Agent with Hosted Tools
from agent_framework import (
HostedCodeInterpreterTool,
HostedFileSearchTool,
HostedWebSearchTool,
)
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_ag
---
*Content truncated.*