azure-ai-projects-py – skill DevOps & Hạ tầng cho agent AI
Xây dựng ứng dụng AI trên Microsoft Foundry bằng SDK azure-ai-projects.
Cài skill azure-ai-projects-py bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/azure-ai-projects-py-cdad6.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /azure-ai-projects-py – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/azure-ai-projects-py-cdad6.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $azure-ai-projects-py – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/azure-ai-projects-py-cdad6.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /azure-ai-projects-py – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/azure-ai-projects-py-cdad6.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /azure-ai-projects-py – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
Azure AI Projects Python SDK
When to Use
Use for Microsoft Foundry project connections, model deployments, versioned agents, evaluation datasets and cloud evaluation workflows. Identify the installed SDK generation first; do not apply classic thread/run recipes to a v2 project client.
Setup and version boundary
Use an isolated environment and the application’s locked, reviewed compatible azure-ai-projects, azure-identity and openai versions. Historical support files came from Microsoft’s pinned repository; see [UPSTREAM-NOTICE.md](UPSTREAM-NOTICE.md) and [UPSTREAM-LICENSE.txt](UPSTREAM-LICENSE.txt). Local corrections are documented there.
Set AZURE_AI_PROJECT_ENDPOINT to the exact authorized HTTPS project URL and AZURE_AI_MODEL_DEPLOYMENT_NAME to an actual deployment name, not an assumed model alias. Use the intended tenant/identity with least privilege; inspect the credential chain without printing credentials. Do not fetch connection secrets for a listing task.
The checked 2.0.0b4 source snapshot uses versioned agents, OpenAI conversations/responses, and beta namespaces for evaluators/memory/schedules. Classic agents belong to azure-ai-agents. Later versions can differ; consult the installed SDK and [Microsoft migration guide](https://learn.microsoft.com/en-us/azure/ai-foundry/agents/how-to/migrate).
Example: create one explicitly requested versioned agent
import os
from azure.identity import DefaultAzureCredential
from azure.ai.projects import AIProjectClient
from azure.ai.projects.models import PromptAgentDefinition
with DefaultAzureCredential() as credential:
with AIProjectClient(endpoint=os.environ["AZURE_AI_PROJECT_ENDPOINT"], credential=credential) as project:
agent = project.agents.create_version(
agent_name="requested-agent",
definition=PromptAgentDefinition(
model=os.environ["AZURE_AI_MODEL_DEPLOYMENT_NAME"],
instructions="Answer the user’s question using authorized information.",
),
)
with project.get_openai_client(timeout=60, max_retries=0) as openai:
response = openai.responses.create(
input="Hello",
extra_body={"agent_reference": {"type": "agent_reference", "name": agent.name, "version": agent.version}},
)
# Inspect authorized output; do not log private traces or credentials.Safe workflow
1. Establish the exact tenant/project, installed versions, requested resources and data classification.
2. Read deployment/connection metadata before selecting a model; do not auto-select the first vaguely matching deployment.
3. Enable only needed tools. Model tool calls are proposals: validate arguments, authorization, destinations and effects before execution. Remote MCP endpoints must be reachable from the cloud; localhost is not the user’s machine.
4. Upload only the selected approved files. Folder extension filters do not exclude secrets or enforce access rights. Persistent memory needs scoped tenant/user isolation, retention and deletion rules.
5. Bound request timeouts, polling, concurrency, rows and spend. If resource creation times out, reconcile its outcome before retrying. Delete only task-created resources specifically intended for cleanup.
Batch evaluation helper
scripts/run_batch_evaluation.py uploads the complete selected JSONL file, creates an evaluation and a run, and may incur cloud/model charges. --allow-paid is an execution opt-in after the user has authorized this exact file, endpoint, evaluators, deployment and budget. It is not an estimate or spend enforcement mechanism.
python scripts/run_batch_evaluation.py --data approved.jsonl --evaluators coherence --deployment approved-deployment --max-rows 100 --max-bytes 1048576 --timeout-seconds 600 --allow-paid --output new-private-results.jsonInput rows must have consistent schemas; agent mode uses sample outputs without mutating source records. Unknown evaluators or missing mapped fields fail before upload. Poll timeout does not cancel remote execution: inspect the printed evaluation/run IDs and cancel through the installed service’s documented API if needed. Local output is new-only and mode 0600. Evaluator names/schemas remain service-version dependent; inspect the registry before a live run.
References
- [Agent operations](references/agents.md) and [tool boundaries](references/tools.md)
- [Evaluation](references/evaluation.md), [built-ins](references/built-in-evaluators.md), [custom evaluators](references/custom-evaluators.md)
- [Connections](references/connections.md), [deployments](references/deployments.md), [datasets/indexes](references/datasets-indexes.md)
- [Async patterns](references/async-patterns.md), [checked API snapshot](references/api-reference.md)
Limitations
No local check proves live Azure availability, model quality, legal compliance or safe autonomous tool use. Evaluation scores are sampled, version-specific judgments; report failures, missing scores, sample count and judge configuration. Keyword checks are format checks, not compliance certification. JSON output must be parsed and schema-validated. Do not run cloud evaluation during documentation review.
Skill liên quan
- azure-ai-projects-ts – SDK cấp cao cho dự án Azure AI Foundry, bao gồm agents, connections, deployments và…
- azure-ai-textanalytics-py – SDK Azure AI Text Analytics để phân tích cảm xúc, nhận diện thực thể, cụm từ khóa, nhận…
- azure-ai-transcription-py – SDK Azure AI Transcription cho Python. Dùng để chuyển file âm thanh thành văn bản kèm…
- k8s-manifest-generator – Tạo manifest Kubernetes sẵn sàng cho production cho Deployments, Services, ConfigMaps và…
- azure-ai-vision-imageanalysis-py – SDK Azure AI Vision Image Analysis cho chú thích, thẻ, đối tượng, OCR, nhận diện người…
- azure-ai-voicelive-dotnet – SDK Azure AI Voice Live cho .NET. Xây dựng ứng dụng AI giọng nói thời gian thực với giao…
- azure-ai-voicelive-py – Xây dựng ứng dụng AI giọng nói thời gian thực với giao tiếp WebSocket hai chiều.
- azure-ai-voicelive-ts – SDK Azure AI Voice Live cho JavaScript/TypeScript. Xây dựng ứng dụng AI giọng nói thời…