# Build Persistent Azure AI Agents with Python

Persistent Azure AI agents require careful setup across authentication, tools, threads, and response handling. This skill provides focused Python patterns for each workflow.

## Install

```bash
npx skillstore add sickn33/agent-framework-azure-ai-py
```

## Metadata

- Status: approved
- Slug: sickn33-agent-framework-azure-ai-py
- Skillstore revision: r2
- Version status: missing
- Tree hash: 6ac7a6024f019be2c50dee6e41a4fdf7cfb6181a4a2eef06c20b1c5f3d6ddbcc
- Author: sickn33
- GitHub username: sickn33
- License: MIT
- Repository: https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/agent-framework-azure-ai-py
- Ref: ebdfe608f5de2b66ff37ab4af12af8ac4f5e8006
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: allowed
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: scripts, external\_commands, network
- Quality score: 78
- Quality tier: bronze
- Public page: https://skillstore.pages.dev/skills/sickn33-agent-framework-azure-ai-py
- Manifest: https://skillstore.pages.dev/api/skills/sickn33-agent-framework-azure-ai-py/manifest

## Capabilities

- Shows how to authenticate with Azure CLI and default Azure credentials.
- Creates persistent Azure AI agents through AzureAIAgentsProvider.
- Adds Python functions, code interpretation, web search, and MCP tools.
- Demonstrates streaming responses and persistent conversation threads.
- Validates structured agent responses with Pydantic models.

## Use Cases

- Prototype an Azure Agent: Create a basic persistent agent with secure Azure authentication and a deployed model.
- Add Hosted and Function Tools: Combine typed Python functions with Azure-hosted code, search, and web capabilities.
- Design Stateful Research Workflows: Use threads, streaming, MCP, and structured outputs in a multi-turn research agent.

## Prompt Templates

### Create a Basic Agent

```
Create a minimal Azure AI agent in Python. Use AzureCliCredential, AzureAIAgentsProvider, an async context manager, and one user request.
```

### Add Typed Function Tools

```
Extend my Azure AI agent with these Python functions: [FUNCTIONS]. Add Annotated parameter descriptions and show one request that invokes a tool.
```

### Implement Persistent Streaming

```
Build a multi-turn agent for [WORKFLOW]. Reuse one conversation thread, stream the second response, and explain where to persist the conversation identifier.
```

### Design a Governed Tool-Enabled Agent

```
Design an Azure AI agent for [USE CASE] using [TOOLS]. Include least-privilege guidance, MCP trust boundaries, structured outputs, error handling, and lifecycle cleanup.
```

## Limitations

- Requires an Azure AI Foundry project, model deployment, and valid Azure credentials.
- Uses prerelease Microsoft Agent Framework packages, so APIs can change.
- Examples require environment-specific permission, network, and cost review.
- Referenced supporting files are listed but are not included in this skill package.

## Best Practices

- Use asynchronous context managers to close credentials, providers, and MCP clients.
- Grant each agent only the tools and Azure permissions required for its task.
- Validate structured responses and test tool behavior before production deployment.

## Anti Patterns

- Do not install unpinned prerelease dependencies in production environments.
- Do not expose code, web, and MCP tools without explicit trust boundaries.
- Do not create a new conversation thread for every turn in one interaction.

## Security Audit

- Audited at: 2026-07-23T20:09:48.291\+00:00
- Summary: Most static alerts are false positives caused by Markdown fences, inline code, Python imports, and Python async context managers. The installation example presents one medium supply-chain risk because it installs unpinned prerelease packages.

## Stats

- Views: 147
- Downloads: 8
- Favorites: 0
- Popularity score: 0
