# Build Container-Based Azure AI Hosted Agents

Deploying custom agent containers in Azure AI Foundry requires precise SDK, identity, registry, and protocol configuration. This skill provides focused Python patterns for creating and managing hosted agents.

## Install

```bash
npx skillstore add sickn33/agents-v2-py
```

## Metadata

- Status: approved
- Slug: sickn33-agents-v2-py
- Skillstore revision: r2
- Version status: missing
- Tree hash: cf94ea7bbe86c65909b20bb7b15b2b3b79c350335d68adf3f7c9832d812d306f
- Author: sickn33
- GitHub username: sickn33
- License: MIT
- Repository: https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/agents-v2-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, env\_access
- Quality score: 69
- Public page: https://skillstore.pages.dev/skills/sickn33-agents-v2-py
- Manifest: https://skillstore.pages.dev/api/skills/sickn33-agents-v2-py/manifest

## Capabilities

- Configures AIProjectClient with DefaultAzureCredential and a project endpoint.
- Creates versioned hosted agents from Azure Container Registry images.
- Defines response protocol, CPU, memory, tools, and container environment variables.
- Lists and deletes hosted agent versions with the Python SDK.
- Provides synchronous and asynchronous agent creation patterns.
- Explains common image, permission, capability host, and protocol errors.

## Use Cases

- Create a First Hosted Agent: Prepare a Python workflow that authenticates and deploys a custom container as an Azure AI hosted agent.
- Standardize Deployment Configuration: Define consistent protocols, resources, tools, image references, and environment settings for hosted agent releases.
- Diagnose Hosted Agent Failures: Review registry permissions, image paths, capability hosts, and protocol versions when agent creation fails.

## Prompt Templates

### Check Prerequisites

```
Review my Azure AI project setup for a container-based hosted agent. Identify missing SDK, registry, identity, capability host, and endpoint requirements.
```

### Draft Agent Creation

```
Create a Python hosted-agent workflow for image [image reference], agent [name], CPU [value], and memory [value]. Use DefaultAzureCredential and fixed image tags.
```

### Configure Tools and Runtime

```
Extend my hosted-agent design with [tools], protocol [protocol], and these non-secret environment settings: [settings]. Explain required permissions and trust boundaries.
```

### Review a Production Design

```
Audit this Azure hosted-agent deployment plan: [plan]. Check image immutability, least privilege, secret handling, MCP trust, resource sizing, cleanup controls, and async lifecycle management.
```

## Limitations

- Requires an existing Azure AI project, container registry, capability host, and assigned pull permissions.
- Does not build, scan, or publish the container image.
- Does not provision Azure resources or role assignments.
- Examples require validation against the installed preview SDK and current Azure service limits.

## Best Practices

- Use immutable image digests or fixed version tags for repeatable deployments.
- Grant only required registry and project permissions through managed identities.
- Validate tool endpoints, protect secrets, and confirm destructive operations before execution.

## Anti Patterns

- Do not deploy production agents from mutable latest image tags.
- Do not place credentials or secrets directly in source code or container settings.
- Do not enable code execution, file access, or MCP tools without reviewing their trust boundaries.

## Security Audit

- Audited at: 2026-07-23T20:31:34.582\+00:00
- Summary: All 65 static findings are false positives caused by Markdown syntax, normal Python imports, example URLs, endpoint-only environment access, and troubleshooting text. Two contextual risks remain: copy-ready examples use mutable latest image tags, and an unguarded example deletes a cloud agent version. No prompt injection or malicious intent was found.

## Stats

- Views: 117
- Downloads: 6
- Favorites: 0
- Popularity score: 0
