본문으로 건너뛰기
Skillpedia
배포 및 클라우드 (DevOps)48k · #4827

hosted-agents-v2-py

하는 일

이 도구는 Azure의 클라우드에서 컨테이너 안에 실행되는 맞춤형 '에이전트'를 만들도록 해 줍니다. 특정 작업을 수행하도록 설정할 수 있는 프로그램이라고 생각하면 됩니다.

사용하는 경우

  • ✓격리된 환경(컨테이너)에서 실행되는 프로그램이 필요할 때.
  • ✓다른 Azure 서비스와 상호작용하도록 에이전트를 설정할 때.
  • ✓코드를 실행하거나 특정 도구를 사용할 수 있는 AI 어시스턴트를 만들 때.

스킬 링크

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/hosted-agents-v2-py/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/hosted-agents-v2-py/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“특정 컨테이너 이미지를 사용하고, CPU 코어 2개와 메모리 4GB를 갖춘 에이전트를 만들어 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

SDK라는 특별한 코드를 사용해 에이전트의 설정, CPU와 메모리 같은 자원 요구량, 사용할 수 있는 도구를 정의합니다. 그 후 Azure가 에이전트를 실행하는 작업을 맡습니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Compatibility and maintenance

Primary editorial path for this compatibility group. The instruction-only procedure remains local; no executable support files are bundled so existing installations continue to work offline. This is one shared procedure, not an additional capability. Preserve the callable ID when an existing manifest or client configuration uses it. Modified in AAS on 2026-09-05; original metadata and license notices are retained.

Azure AI Hosted Agents (Python)

Build container-based hosted agents using HostedAgentDefinition from the Azure AI Projects SDK.

Installation

pip install 'azure-ai-projects==2.3.0' azure-identity

These are SDK 2.3.0 instruction fragments aligned with the current Microsoft hosted-agent guide. Validate the installed schema and service support before provisioning; documentation inspection is not a cloud integration test.

Environment Variables

export AZURE_AI_PROJECT_ENDPOINT="https://<resource>.services.ai.azure.com/api/projects/<project>"

Prerequisites

Before creating hosted agents:

  1. Container Image - Build and push to Azure Container Registry (ACR)
  2. ACR Pull Permissions - Grant the project identity the registry role supported by its permission mode; current hosted-agent guidance uses Container Registry Repository Reader
  3. Capability Host - Confirm current project/region hosted-agent availability and the application's network policy; do not enable public hosting automatically
  4. SDK Version - Ensure azure-ai-projects==2.3.0

Authentication

Use the approved Azure credential flow for the intended tenant/subscription; this sketch uses DefaultAzureCredential:

from azure.identity import DefaultAzureCredential
from azure.ai.projects import AIProjectClient

import os

credential = DefaultAzureCredential()
client = AIProjectClient(
    endpoint=os.environ["AZURE_AI_PROJECT_ENDPOINT"],
    credential=credential
)

Core Workflow

1. Imports

import os
from azure.identity import DefaultAzureCredential
from azure.ai.projects import AIProjectClient
from azure.ai.projects.models import (
    HostedAgentDefinition,
    ContainerConfiguration,
    ProtocolVersionRecord,
    AgentEndpointProtocol,
)

2. Create Hosted Agent

client = AIProjectClient(
    endpoint=os.environ["AZURE_AI_PROJECT_ENDPOINT"],
    credential=DefaultAzureCredential()
)

agent = client.agents.create_version(
    agent_name="my-hosted-agent",
    definition=HostedAgentDefinition(
        protocol_versions=[
            ProtocolVersionRecord(protocol=AgentEndpointProtocol.RESPONSES, version="2.0.0")
        ],
        cpu="1",
        memory="2Gi",
        container_configuration=ContainerConfiguration(image=os.environ["REVIEWED_CONTAINER_IMAGE"]),
        environment_variables={
            "AZURE_AI_PROJECT_ENDPOINT": os.environ["AZURE_AI_PROJECT_ENDPOINT"],
            "MODEL_NAME": os.environ["MODEL_DEPLOYMENT_NAME"]
        }
    )
)

print(f"Created agent: {agent.name} (version: {agent.version})")

3. List Agent Versions

versions = client.agents.list_versions(agent_name="my-hosted-agent")
for version in versions:
    print(f"Version: {version.version}")  # Inspect supported status fields via get_version

Inspect the exact returned model for supported fields; a created version is not proof a running container is healthy. Close synchronous client/credential resources through their supported context managers or close() methods.

4. Delete Agent Version

client.agents.delete_version(
    agent_name="my-hosted-agent",
    agent_version=agent.version
)

HostedAgentDefinition Parameters

Parameter Type Required Description
protocol_versions list[ProtocolVersionRecord] Yes Protocol versions the agent supports
container_configuration ContainerConfiguration Yes for an image deployment Reviewed registry image reference
cpu str No CPU allocation (e.g., "1", "2")
memory str No Memory allocation (e.g., "2Gi", "4Gi")
environment_variables dict[str, str] No Environment variables for the container

Protocol Versions

The protocol_versions parameter specifies which protocols your agent supports:

from azure.ai.projects.models import ProtocolVersionRecord, AgentEndpointProtocol

# RESPONSES protocol - standard agent responses

…
자주 묻는 질문

'호스팅 에이전트'란 무엇인가요?

직접 만든 프로그램을 Azure가 컨테이너 환경에서 실행해 주어, 작업을 수행할 준비가 된 상태로 두는 것입니다.

이것을 사용하려면 코딩을 알아야 하나요?

네, 에이전트를 설정하려면 Python 코드를 조금 작성해야 합니다. 다만 도구가 Azure에서 실행하는 과정을 간단하게 해 줍니다.

에이전트가 코드 인터프리터 같은 도구를 사용하게 할 수 있나요?

네, 코드 인터프리터나 다른 Azure 전용 도구를 사용하도록 에이전트를 설정할 수 있습니다.

상세 정보

작성자의 원본 설명

Build hosted agents using Azure AI Projects SDK with HostedAgentDefinition. Use when creating container-based agents in Azure AI Foundry.

repo: sickn33/agentic-awesome-skills

인기도

GitHub 스타
48k
순위
#4827
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬