[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7DHB3GP6DHWTN3BFMHKBXN2":3,"skill-same:01M7DHB3GP6DHWTN3BFMHKBXN2":96},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":27,"commitSha":28,"skillDirectory":29,"forksCount":13,"repositoryHtmlUrl":30,"repositoryHomepageUrl":31,"ownerHtmlUrl":32,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":33,"install":34,"resources":47},"01M7DHB3GP6DHWTN3BFMHKBXN2","azure-ai-projects-py",null,"Build AI applications using the Azure AI Projects Python SDK (azure-ai-projects). Use when working with Foundry project clients, creating versioned agents with PromptAgentDefinition, running evaluations, managing connections\u002Fdeployments\u002Fdatasets\u002Findexes, or using OpenAI-compatible clients. This is the high-level Foundry SDK - for low-level agent operations, use azure-ai-agents-python skill.","ak2dev\u002Fagentguard","ak2dev","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F233005497?v=4","01M7DGWK3E3XCC276C6YRFSN05","01M7DGWK4J2A9WQ44CS5CRP4R6",0,"MIT","https:\u002F\u002Fgithub.com\u002Fak2dev\u002Fagentguard\u002Fblob\u002Fmain\u002Fbench\u002Fcorpus\u002Fbenign\u002Freal-ms-azure-ai-projects-py\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: azure-ai-projects-py\ndescription: Build AI applications using the Azure AI Projects Python SDK (azure-ai-projects). Use when working with Foundry project clients, creating versioned agents with PromptAgentDefinition, running evaluations, managing connections\u002Fdeployments\u002Fdatasets\u002Findexes, or using OpenAI-compatible clients. This is the high-level Foundry SDK - for low-level agent operations, use azure-ai-agents-python skill.\nlicense: MIT\nmetadata:\n  author: Microsoft\n  version: \"1.0.0\"\n  package: azure-ai-projects\n---\n\n# Azure AI Projects Python SDK (Foundry SDK)\n\nBuild AI applications on Microsoft Foundry using the `azure-ai-projects` SDK.\n\n## Installation\n\n```bash\npip install azure-ai-projects azure-identity\n```\n\n## Environment Variables\n\n```bash\nAZURE_AI_PROJECT_ENDPOINT=\"https:\u002F\u002F\u003Cresource>.services.ai.azure.com\u002Fapi\u002Fprojects\u002F\u003Cproject>\"  # Required for all auth methods\nAZURE_AI_MODEL_DEPLOYMENT_NAME=\"gpt-4o-mini\"  # Required for all auth methods\nAZURE_TOKEN_CREDENTIALS=prod # Required only if DefaultAzureCredential is used in production\n```\n\n## Authentication & Lifecycle\n\n> **🔑 Two rules apply to every code sample below:**\n>\n> 1. **Prefer `DefaultAzureCredential`.** It works locally (Azure CLI \u002F VS Code \u002F Developer CLI) and in Azure (managed identity, workload identity) with no code change. Avoid connection strings, account\u002FAPI keys — they bypass Entra audit and rotation.\n>    - Local dev: `DefaultAzureCredential` works as-is.\n>    - Production: set `AZURE_TOKEN_CREDENTIALS=prod` (or `AZURE_TOKEN_CREDENTIALS=\u003Cspecific_credential>`) to constrain the credential chain to production-safe credentials.\n> 2. **Wrap every client in a context manager** so HTTP transports, sockets, and token caches are released deterministically:\n>    - Sync: `with \u003CClient>(...) as client:`\n>    - Async: `async with \u003CClient>(...) as client:` **and** `async with DefaultAzureCredential() as credential:` (from `azure.identity.aio`)\n>\n> Snippets may abbreviate this setup, but production code should always follow both rules.\n\n```python\nimport os\nfrom azure.identity import DefaultAzureCredential, ManagedIdentityCredential\nfrom azure.ai.projects import AIProjectClient\n\n# Local dev: DefaultAzureCredential. Production: set AZURE_TOKEN_CREDENTIALS=prod or AZURE_TOKEN_CREDENTIALS=\u003Cspecific_credential>\ncredential = DefaultAzureCredential()\n# Or use a specific credential directly in production:\n# See https:\u002F\u002Flearn.microsoft.com\u002Fpython\u002Fapi\u002Foverview\u002Fazure\u002Fidentity-readme?view=azure-python#credential-classes\n# credential = ManagedIdentityCredential()\nwith AIProjectClient(\n    endpoint=os.environ[\"AZURE_AI_PROJECT_ENDPOINT\"],\n    credential=credential,\n) as client:\n    deployments = list(client.deployments.list())\n```\n\n## Client Operations Overview\n\n| Operation | Access | Purpose |\n|-----------|--------|---------|\n| `client.agents` | `.agents.*` | Agent CRUD, versions, threads, runs |\n| `client.connections` | `.connections.*` | List\u002Fget project connections |\n| `client.deployments` | `.deployments.*` | List model deployments |\n| `client.datasets` | `.datasets.*` | Dataset management |\n| `client.indexes` | `.indexes.*` | Index management |\n| `client.evaluations` | `.evaluations.*` | Run evaluations |\n| `client.red_teams` | `.red_teams.*` | Red team operations |\n\n## Two Client Approaches\n\n### 1. AIProjectClient (Native Foundry)\n\n```python\nfrom azure.ai.projects import AIProjectClient\n\nwith AIProjectClient(\n    endpoint=os.environ[\"AZURE_AI_PROJECT_ENDPOINT\"],\n    credential=DefaultAzureCredential(),\n) as client:\n    # Use Foundry-native operations\n    agent = client.agents.create_agent(\n        model=os.environ[\"AZURE_AI_MODEL_DEPLOYMENT_NAME\"],\n        name=\"my-agent\",\n        instructions=\"You are helpful.\",\n    )\n```\n\n### 2. OpenAI-Compatible Client\n\n```python\n# Get OpenAI-compatible client from project\nopenai_client = client.get_openai_client()\n\n# Use standard OpenAI API\nresponse = openai_client.chat.completions.create(\n    model=os.environ[\"AZURE_AI_MODEL_DEPLOYMENT_NAME\"],\n    messages=[{\"role\": \"user\", \"content\": \"Hello!\"}],\n)\n```\n\n## Agent Operations\n\n### Create Agent (Basic)\n\n```python\nagent = client.agents.create_agent(\n    model=os.environ[\"AZURE_AI_MODEL_DEPLOYMENT_NAME\"],\n    name=\"my-agent\",\n    instructions=\"You are a helpful assistant.\",\n)\n```\n\n### Create Agent with Tools\n\n```python\nfrom azure.ai.agents.models import CodeInterpreterTool, FileSearchTool\n\nagent = client.agents.create_agent(\n    model=os.environ[\"AZURE_AI_MODEL_DEPLOYMENT_NAME\"],\n    name=\"tool-agent\",\n    instructions=\"You can execute code and search files.\",\n    tools=[CodeInterpreterTool(), FileSearchTool()],\n)\n```\n\n### Versioned Agents with PromptAgentDefinition\n\n```python\nfrom azure.ai.projects.models import PromptAgentDefinition\n\n# Create a versioned agent\nagent_version = client.agents.create_version(\n    agent_name=\"customer-support-agent\",\n    definition=PromptAgentDefinition(\n        model=os.environ[\"AZURE_AI_MODEL_DEPLOYMENT_NAME\"],\n        instructions=\"You are a customer support specialist.\",\n        tools=[],  # Add tools as needed\n    ),\n    version_label=\"v1.0\",\n)\n```\n\nSee [references\u002Fagents.md](references\u002Fagents.md) for detailed agent patterns.\n\n## Tools Overview\n\n| Tool | Class | Use Case |\n|------|-------|----------|\n| Code Interpreter | `CodeInterpreterTool` | Execute Python, generate files |\n| File Search | `FileSearchTool` | RAG over uploaded documents |\n| Bing Grounding | `BingGroundingTool` | Web search (requires connection) |\n| Azure AI Search | `AzureAISearchTool` | Search your indexes |\n| Function Calling | `FunctionTool` | Call your Python functions |\n| OpenAPI | `OpenApiTool` | Call REST APIs |\n| MCP | `McpTool` | Model Context Protocol servers |\n| Memory Search | `MemorySearchTool` | Search agent memory stores |\n| SharePoint | `SharepointGroundingTool` | Search SharePoint content |\n\nSee [references\u002Ftools.md](references\u002Ftools.md) for all tool patterns.\n\n## Thread and Message Flow\n\n```python\n# 1. Create thread\nthread = client.agents.threads.create()\n\n# 2. Add message\nclient.agents.messages.create(\n    thread_id=thread.id,\n    role=\"user\",\n    content=\"What's the weather like?\",\n)\n\n# 3. Create and process run\nrun = client.agents.runs.create_and_process(\n    thread_id=thread.id,\n    agent_id=agent.id,\n)\n\n# 4. Get response\nif run.status == \"completed\":\n    messages = client.agents.messages.list(thread_id=thread.id)\n    for msg in messages:\n        if msg.role == \"assistant\":\n            print(msg.content[0].text.value)\n```\n\n## Connections\n\n```python\n# List all connections\nconnections = client.connections.list()\nfor conn in connections:\n    print(f\"{conn.name}: {conn.connection_type}\")\n\n# Get specific connection\nconnection = client.connections.get(connection_name=\"my-search-connection\")\n```\n\nSee [references\u002Fconnections.md](references\u002Fconnections.md) for connection patterns.\n\n## Deployments\n\n```python\n# List available model deployments\ndeployments = client.deployments.list()\nfor deployment in deployments:\n    print(f\"{deployment.name}: {deployment.model}\")\n```\n\nSee [references\u002Fdeployments.md](references\u002Fdeployments.md) for deployment patterns.\n\n## Datasets and Indexes\n\n```python\n# List datasets\ndatasets = client.datasets.list()\n\n# List indexes\nindexes = client.indexes.list()\n```\n\nSee [references\u002Fdatasets-indexes.md](references\u002Fdatasets-indexes.md) for data operations.\n\n## Evaluation\n\n```python\n# Using OpenAI client for evals\nopenai_client = client.get_openai_client()\n\n# Create evaluation with built-in evaluators\neval_run = openai_client.evals.runs.create(\n    eval_id=\"my-eval\",\n    name=\"quality-check\",\n    data_source={\n        \"type\": \"custom\",\n        \"item_references\": [{\"item_id\": \"test-1\"}],\n    },\n    testing_criteria=[\n        {\"type\": \"fluency\"},\n        {\"type\": \"task_adherence\"},\n    ],\n)\n```\n\nSee [references\u002Fevaluation.md](references\u002Fevaluation.md) for evaluation patterns.\n\n## Async Client\n\n```python\nfrom azure.ai.projects.aio import AIProjectClient\n\nasync with AIProjectClient(\n    endpoint=os.environ[\"AZURE_AI_PROJECT_ENDPOINT\"],\n    credential=DefaultAzureCredential(),\n) as client:\n    agent = await client.agents.create_agent(...)\n    # ... async operations\n```\n\nSee [references\u002Fasync-patterns.md](references\u002Fasync-patterns.md) for async patterns.\n\n## Memory Stores\n\n```python\n# Create memory store for agent\nmemory_store = client.agents.create_memory_store(\n    name=\"conversation-memory\",\n)\n\n# Attach to agent for persistent memory\nagent = client.agents.create_agent(\n    model=os.environ[\"AZURE_AI_MODEL_DEPLOYMENT_NAME\"],\n    name=\"memory-agent\",\n    tools=[MemorySearchTool()],\n    tool_resources={\"memory\": {\"store_ids\": [memory_store.id]}},\n)\n```\n\n## Best Practices\n\n1. **Pick sync OR async and stay consistent.** Do not mix `azure.ai.projects` sync clients with `azure.ai.projects.aio` async clients in the same call path. Choose one mode per module.\n2. **Always use context managers for clients and async credentials.** Wrap every client in `with AIProjectClient(...) as client:` (sync) or `async with AIProjectClient(...) as client:` (async). For async `DefaultAzureCredential` from `azure.identity.aio`, also use `async with credential:` so tokens and transports are cleaned up.\n3. **Clean up agents** when done: `client.agents.delete_agent(agent.id)`\n4. **Use `create_and_process`** for simple runs, **streaming** for real-time UX\n5. **Use versioned agents** for production deployments\n6. **Prefer connections** for external service integration (AI Search, Bing, etc.)\n\n## SDK Comparison\n\n| Feature | `azure-ai-projects` | `azure-ai-agents` |\n|---------|---------------------|-------------------|\n| Level | High-level (Foundry) | Low-level (Agents) |\n| Client | `AIProjectClient` | `AgentsClient` |\n| Versioning | `create_version()` | Not available |\n| Connections | Yes | No |\n| Deployments | Yes | No |\n| Datasets\u002FIndexes | Yes | No |\n| Evaluation | Via OpenAI client | No |\n| When to use | Full Foundry integration | Standalone agent apps |\n\n## Reference Files\n\n- [references\u002Fagents.md](references\u002Fagents.md): Agent operations with PromptAgentDefinition\n- [references\u002Ftools.md](references\u002Ftools.md): All agent tools with examples\n- [references\u002Fevaluation.md](references\u002Fevaluation.md): Evaluation operations overview\n- [references\u002Fbuilt-in-evaluators.md](references\u002Fbuilt-in-evaluators.md): Complete built-in evaluator reference\n- [references\u002Fcustom-evaluators.md](references\u002Fcustom-evaluators.md): Code and prompt-based evaluator patterns\n- [references\u002Fconnections.md](references\u002Fconnections.md): Connection operations\n- [references\u002Fdeployments.md](references\u002Fdeployments.md): Deployment enumeration\n- [references\u002Fdatasets-indexes.md](references\u002Fdatasets-indexes.md): Dataset and index operations\n- [references\u002Fasync-patterns.md](references\u002Fasync-patterns.md): Async client usage\n- [references\u002Fapi-reference.md](references\u002Fapi-reference.md): Complete API reference for all 373 SDK exports (v2.0.0b4)\n- [scripts\u002Frun_batch_evaluation.py](scripts\u002Frun_batch_evaluation.py): CLI tool for batch evaluations\n","# Azure AI Projects Python SDK (Foundry SDK)\n\nBuild AI applications on Microsoft Foundry using the `azure-ai-projects` SDK.\n\n## Installation\n\n```bash\npip install azure-ai-projects azure-identity\n```\n\n## Environment Variables\n\n```bash\nAZURE_AI_PROJECT_ENDPOINT=\"https:\u002F\u002F\u003Cresource>.services.ai.azure.com\u002Fapi\u002Fprojects\u002F\u003Cproject>\"  # Required for all auth methods\nAZURE_AI_MODEL_DEPLOYMENT_NAME=\"gpt-4o-mini\"  # Required for all auth methods\nAZURE_TOKEN_CREDENTIALS=prod # Required only if DefaultAzureCredential is used in production\n```\n\n## Authentication & Lifecycle\n\n> **🔑 Two rules apply to every code sample below:**\n>\n> 1. **Prefer `DefaultAzureCredential`.** It works locally (Azure CLI \u002F VS Code \u002F Developer CLI) and in Azure (managed identity, workload identity) with no code change. Avoid connection strings, account\u002FAPI keys — they bypass Entra audit and rotation.\n>    - Local dev: `DefaultAzureCredential` works as-is.\n>    - Production: set `AZURE_TOKEN_CREDENTIALS=prod` (or `AZURE_TOKEN_CREDENTIALS=\u003Cspecific_credential>`) to constrain the credential chain to production-safe credentials.\n> 2. **Wrap every client in a context manager** so HTTP transports, sockets, and token caches are released deterministically:\n>    - Sync: `with \u003CClient>(...) as client:`\n>    - Async: `async with \u003CClient>(...) as client:` **and** `async with DefaultAzureCredential() as credential:` (from `azure.identity.aio`)\n>\n> Snippets may abbreviate this setup, but production code should always follow both rules.\n\n```python\nimport os\nfrom azure.identity import DefaultAzureCredential, ManagedIdentityCredential\nfrom azure.ai.projects import AIProjectClient\n\n# Local dev: DefaultAzureCredential. Production: set AZURE_TOKEN_CREDENTIALS=prod or AZURE_TOKEN_CREDENTIALS=\u003Cspecific_credential>\ncredential = DefaultAzureCredential()\n# Or use a specific credential directly in production:\n# See https:\u002F\u002Flearn.microsoft.com\u002Fpython\u002Fapi\u002Foverview\u002Fazure\u002Fidentity-readme?view=azure-python#credential-classes\n# credential = ManagedIdentityCredential()\nwith AIProjectClient(\n    endpoint=os.environ[\"AZURE_AI_PROJECT_ENDPOINT\"],\n    credential=credential,\n) as client:\n    deployments = list(client.deployments.list())\n```\n\n## Client Operations Overview\n\n| Operation | Access | Purpose |\n|-----------|--------|---------|\n| `client.agents` | `.agents.*` | Agent CRUD, versions, threads, runs |\n| `client.connections` | `.connections.*` | List\u002Fget project connections |\n| `client.deployments` | `.deployments.*` | List model deployments |\n| `client.datasets` | `.datasets.*` | Dataset management |\n| `client.indexes` | `.indexes.*` | Index management |\n| `client.evaluations` | `.evaluations.*` | Run evaluations |\n| `client.red_teams` | `.red_teams.*` | Red team operations |\n\n## Two Client Approaches\n\n### 1. AIProjectClient (Native Foundry)\n\n```python\nfrom azure.ai.projects import AIProjectClient\n\nwith AIProjectClient(\n    endpoint=os.environ[\"AZURE_AI_PROJECT_ENDPOINT\"],\n    credential=DefaultAzureCredential(),\n) as client:\n    # Use Foundry-native operations\n    agent = client.agents.create_agent(\n        model=os.environ[\"AZURE_AI_MODEL_DEPLOYMENT_NAME\"],\n        name=\"my-agent\",\n        instructions=\"You are helpful.\",\n    )\n```\n\n### 2. OpenAI-Compatible Client\n\n```python\n# Get OpenAI-compatible client from project\nopenai_client = client.get_openai_client()\n\n# Use standard OpenAI API\nresponse = openai_client.chat.completions.create(\n    model=os.environ[\"AZURE_AI_MODEL_DEPLOYMENT_NAME\"],\n    messages=[{\"role\": \"user\", \"content\": \"Hello!\"}],\n)\n```\n\n## Agent Operations\n\n### Create Agent (Basic)\n\n```python\nagent = client.agents.create_agent(\n    model=os.environ[\"AZURE_AI_MODEL_DEPLOYMENT_NAME\"],\n    name=\"my-agent\",\n    instructions=\"You are a helpful assistant.\",\n)\n```\n\n### Create Agent with Tools\n\n```python\nfrom azure.ai.agents.models import CodeInterpreterTool, FileSearchTool\n\nagent = client.agents.create_agent(\n    model=os.environ[\"AZURE_AI_MODEL_DEPLOYMENT_NAME\"],\n    name=\"tool-agent\",\n    instructions=\"You can execute code and search files.\",\n    tools=[CodeInterpreterTool(), FileSearchTool()],\n)\n```\n\n### Versioned Agents with PromptAgentDefinition\n\n```python\nfrom azure.ai.projects.models import PromptAgentDefinition\n\n# Create a versioned agent\nagent_version = client.agents.create_version(\n    agent_name=\"customer-support-agent\",\n    definition=PromptAgentDefinition(\n        model=os.environ[\"AZURE_AI_MODEL_DEPLOYMENT_NAME\"],\n        instructions=\"You are a customer support specialist.\",\n        tools=[],  # Add tools as needed\n    ),\n    version_label=\"v1.0\",\n)\n```\n\nSee [references\u002Fagents.md](references\u002Fagents.md) for detailed agent patterns.\n\n## Tools Overview\n\n| Tool | Class | Use Case |\n|------|-------|----------|\n| Code Interpreter | `CodeInterpreterTool` | Execute Python, generate files |\n| File Search | `FileSearchTool` | RAG over uploaded documents |\n| Bing Grounding | `BingGroundingTool` | Web search (requires connection) |\n| Azure AI Search | `AzureAISearchTool` | Search your indexes |\n| Function Calling | `FunctionTool` | Call your Python functions |\n| OpenAPI | `OpenApiTool` | Call REST APIs |\n| MCP | `McpTool` | Model Context Protocol servers |\n| Memory Search | `MemorySearchTool` | Search agent memory stores |\n| SharePoint | `SharepointGroundingTool` | Search SharePoint content |\n\nSee [references\u002Ftools.md](references\u002Ftools.md) for all tool patterns.\n\n## Thread and Message Flow\n\n```python\n# 1. Create thread\nthread = client.agents.threads.create()\n\n# 2. Add message\nclient.agents.messages.create(\n    thread_id=thread.id,\n    role=\"user\",\n    content=\"What's the weather like?\",\n)\n\n# 3. Create and process run\nrun = client.agents.runs.create_and_process(\n    thread_id=thread.id,\n    agent_id=agent.id,\n)\n\n# 4. Get response\nif run.status == \"completed\":\n    messages = client.agents.messages.list(thread_id=thread.id)\n    for msg in messages:\n        if msg.role == \"assistant\":\n            print(msg.content[0].text.value)\n```\n\n## Connections\n\n```python\n# List all connections\nconnections = client.connections.list()\nfor conn in connections:\n    print(f\"{conn.name}: {conn.connection_type}\")\n\n# Get specific connection\nconnection = client.connections.get(connection_name=\"my-search-connection\")\n```\n\nSee [references\u002Fconnections.md](references\u002Fconnections.md) for connection patterns.\n\n## Deployments\n\n```python\n# List available model deployments\ndeployments = client.deployments.list()\nfor deployment in deployments:\n    print(f\"{deployment.name}: {deployment.model}\")\n```\n\nSee [references\u002Fdeployments.md](references\u002Fdeployments.md) for deployment patterns.\n\n## Datasets and Indexes\n\n```python\n# List datasets\ndatasets = client.datasets.list()\n\n# List indexes\nindexes = client.indexes.list()\n```\n\nSee [references\u002Fdatasets-indexes.md](references\u002Fdatasets-indexes.md) for data operations.\n\n## Evaluation\n\n```python\n# Using OpenAI client for evals\nopenai_client = client.get_openai_client()\n\n# Create evaluation with built-in evaluators\neval_run = openai_client.evals.runs.create(\n    eval_id=\"my-eval\",\n    name=\"quality-check\",\n    data_source={\n        \"type\": \"custom\",\n        \"item_references\": [{\"item_id\": \"test-1\"}],\n    },\n    testing_criteria=[\n        {\"type\": \"fluency\"},\n        {\"type\": \"task_adherence\"},\n    ],\n)\n```\n\nSee [references\u002Fevaluation.md](references\u002Fevaluation.md) for evaluation patterns.\n\n## Async Client\n\n```python\nfrom azure.ai.projects.aio import AIProjectClient\n\nasync with AIProjectClient(\n    endpoint=os.environ[\"AZURE_AI_PROJECT_ENDPOINT\"],\n    credential=DefaultAzureCredential(),\n) as client:\n    agent = await client.agents.create_agent(...)\n    # ... async operations\n```\n\nSee [references\u002Fasync-patterns.md](references\u002Fasync-patterns.md) for async patterns.\n\n## Memory Stores\n\n```python\n# Create memory store for agent\nmemory_store = client.agents.create_memory_store(\n    name=\"conversation-memory\",\n)\n\n# Attach to agent for persistent memory\nagent = client.agents.create_agent(\n    model=os.environ[\"AZURE_AI_MODEL_DEPLOYMENT_NAME\"],\n    name=\"memory-agent\",\n    tools=[MemorySearchTool()],\n    tool_resources={\"memory\": {\"store_ids\": [memory_store.id]}},\n)\n```\n\n## Best Practices\n\n1. **Pick sync OR async and stay consistent.** Do not mix `azure.ai.projects` sync clients with `azure.ai.projects.aio` async clients in the same call path. Choose one mode per module.\n2. **Always use context managers for clients and async credentials.** Wrap every client in `with AIProjectClient(...) as client:` (sync) or `async with AIProjectClient(...) as client:` (async). For async `DefaultAzureCredential` from `azure.identity.aio`, also use `async with credential:` so tokens and transports are cleaned up.\n3. **Clean up agents** when done: `client.agents.delete_agent(agent.id)`\n4. **Use `create_and_process`** for simple runs, **streaming** for real-time UX\n5. **Use versioned agents** for production deployments\n6. **Prefer connections** for external service integration (AI Search, Bing, etc.)\n\n## SDK Comparison\n\n| Feature | `azure-ai-projects` | `azure-ai-agents` |\n|---------|---------------------|-------------------|\n| Level | High-level (Foundry) | Low-level (Agents) |\n| Client | `AIProjectClient` | `AgentsClient` |\n| Versioning | `create_version()` | Not available |\n| Connections | Yes | No |\n| Deployments | Yes | No |\n| Datasets\u002FIndexes | Yes | No |\n| Evaluation | Via OpenAI client | No |\n| When to use | Full Foundry integration | Standalone agent apps |\n\n## Reference Files\n\n- [references\u002Fagents.md](references\u002Fagents.md): Agent operations with PromptAgentDefinition\n- [references\u002Ftools.md](references\u002Ftools.md): All agent tools with examples\n- [references\u002Fevaluation.md](references\u002Fevaluation.md): Evaluation operations overview\n- [references\u002Fbuilt-in-evaluators.md](references\u002Fbuilt-in-evaluators.md): Complete built-in evaluator reference\n- [references\u002Fcustom-evaluators.md](references\u002Fcustom-evaluators.md): Code and prompt-based evaluator patterns\n- [references\u002Fconnections.md](references\u002Fconnections.md): Connection operations\n- [references\u002Fdeployments.md](references\u002Fdeployments.md): Deployment enumeration\n- [references\u002Fdatasets-indexes.md](references\u002Fdatasets-indexes.md): Dataset and index operations\n- [references\u002Fasync-patterns.md](references\u002Fasync-patterns.md): Async client usage\n- [references\u002Fapi-reference.md](references\u002Fapi-reference.md): Complete API reference for all 373 SDK exports (v2.0.0b4)\n- [scripts\u002Frun_batch_evaluation.py](scripts\u002Frun_batch_evaluation.py): CLI tool for batch evaluations\n",{"name":5,"license":14,"metadata":23,"description":7},{"author":24,"package":25,"version":26},"Microsoft","azure-ai-projects","1.0.0","main","634c25395a24b98cd6125453ad4abb65517bcabb","bench\u002Fcorpus\u002Fbenign\u002Freal-ms-azure-ai-projects-py","https:\u002F\u002Fgithub.com\u002Fak2dev\u002Fagentguard","https:\u002F\u002Fsite-bionic8.vercel.app","https:\u002F\u002Fgithub.com\u002Fak2dev","2026-11-11 02:37:06",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add ak2dev\u002Fagentguard --skill azure-ai-projects-py",{"tool":40,"command":41},"bunx","bunx skills add ak2dev\u002Fagentguard --skill azure-ai-projects-py",{"tool":43,"command":44},"pnpm","pnpm dlx skills add ak2dev\u002Fagentguard --skill azure-ai-projects-py","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fak2dev\u002Fagentguard\u002Fblob\u002Fmain\u002Fbench\u002Fcorpus\u002Fbenign\u002Freal-ms-azure-ai-projects-py\u002FSKILL.md",true,[48,54,58,62,66,70,74,78,82,86,90],{"path":49,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":52,"sourceHtmlUrl":53},"references\u002Fagents.md","REFERENCE","参考文档",6869,"https:\u002F\u002Fgithub.com\u002Fak2dev\u002Fagentguard\u002Fblob\u002Fmain\u002Fbench\u002Fcorpus\u002Fbenign\u002Freal-ms-azure-ai-projects-py\u002Freferences\u002Fagents.md",{"path":55,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":56,"sourceHtmlUrl":57},"references\u002Fapi-reference.md",27988,"https:\u002F\u002Fgithub.com\u002Fak2dev\u002Fagentguard\u002Fblob\u002Fmain\u002Fbench\u002Fcorpus\u002Fbenign\u002Freal-ms-azure-ai-projects-py\u002Freferences\u002Fapi-reference.md",{"path":59,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":60,"sourceHtmlUrl":61},"references\u002Fasync-patterns.md",7009,"https:\u002F\u002Fgithub.com\u002Fak2dev\u002Fagentguard\u002Fblob\u002Fmain\u002Fbench\u002Fcorpus\u002Fbenign\u002Freal-ms-azure-ai-projects-py\u002Freferences\u002Fasync-patterns.md",{"path":63,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":64,"sourceHtmlUrl":65},"references\u002Fbuilt-in-evaluators.md",11759,"https:\u002F\u002Fgithub.com\u002Fak2dev\u002Fagentguard\u002Fblob\u002Fmain\u002Fbench\u002Fcorpus\u002Fbenign\u002Freal-ms-azure-ai-projects-py\u002Freferences\u002Fbuilt-in-evaluators.md",{"path":67,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":68,"sourceHtmlUrl":69},"references\u002Fconnections.md",4767,"https:\u002F\u002Fgithub.com\u002Fak2dev\u002Fagentguard\u002Fblob\u002Fmain\u002Fbench\u002Fcorpus\u002Fbenign\u002Freal-ms-azure-ai-projects-py\u002Freferences\u002Fconnections.md",{"path":71,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":72,"sourceHtmlUrl":73},"references\u002Fcustom-evaluators.md",14411,"https:\u002F\u002Fgithub.com\u002Fak2dev\u002Fagentguard\u002Fblob\u002Fmain\u002Fbench\u002Fcorpus\u002Fbenign\u002Freal-ms-azure-ai-projects-py\u002Freferences\u002Fcustom-evaluators.md",{"path":75,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":76,"sourceHtmlUrl":77},"references\u002Fdatasets-indexes.md",4272,"https:\u002F\u002Fgithub.com\u002Fak2dev\u002Fagentguard\u002Fblob\u002Fmain\u002Fbench\u002Fcorpus\u002Fbenign\u002Freal-ms-azure-ai-projects-py\u002Freferences\u002Fdatasets-indexes.md",{"path":79,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":80,"sourceHtmlUrl":81},"references\u002Fdeployments.md",3569,"https:\u002F\u002Fgithub.com\u002Fak2dev\u002Fagentguard\u002Fblob\u002Fmain\u002Fbench\u002Fcorpus\u002Fbenign\u002Freal-ms-azure-ai-projects-py\u002Freferences\u002Fdeployments.md",{"path":83,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":84,"sourceHtmlUrl":85},"references\u002Fevaluation.md",10975,"https:\u002F\u002Fgithub.com\u002Fak2dev\u002Fagentguard\u002Fblob\u002Fmain\u002Fbench\u002Fcorpus\u002Fbenign\u002Freal-ms-azure-ai-projects-py\u002Freferences\u002Fevaluation.md",{"path":87,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":88,"sourceHtmlUrl":89},"references\u002Ftools.md",12016,"https:\u002F\u002Fgithub.com\u002Fak2dev\u002Fagentguard\u002Fblob\u002Fmain\u002Fbench\u002Fcorpus\u002Fbenign\u002Freal-ms-azure-ai-projects-py\u002Freferences\u002Ftools.md",{"path":91,"resourceType":92,"resourceTypeDesc":93,"sizeBytes":94,"sourceHtmlUrl":95},"scripts\u002Frun_batch_evaluation.py","SCRIPT","脚本",12507,"https:\u002F\u002Fgithub.com\u002Fak2dev\u002Fagentguard\u002Fblob\u002Fmain\u002Fbench\u002Fcorpus\u002Fbenign\u002Freal-ms-azure-ai-projects-py\u002Fscripts\u002Frun_batch_evaluation.py",[97,105,110,115,120,126],{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":101,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":18},"01M7DJ7GBSJBJ32GXNQXVAMNYK","csv-tool","Summarize CSV files and report column statistics.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fak2dev\u002Fagentguard\u002Fblob\u002Fmain\u002Ffixtures\u002Frules\u002FAG-SYS-002\u002Fpositive\u002Ffault\u002Fcsv-tool\u002FSKILL.md",[],[],{"skillNo":106,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":101,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":18},"01M7DJ7F00PA7EHFM39RVCC8R5","https:\u002F\u002Fgithub.com\u002Fak2dev\u002Fagentguard\u002Fblob\u002Fmain\u002Ffixtures\u002Frules\u002FAG-SYS-002\u002Fnegative\u002Fnormal\u002Fcsv-tool\u002FSKILL.md",[],[],{"skillNo":111,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":101,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":18},"01M7DJ7DP7KDW7MYY5Q0R0JFEN","https:\u002F\u002Fgithub.com\u002Fak2dev\u002Fagentguard\u002Fblob\u002Fmain\u002Ffixtures\u002Frules\u002FAG-SYS-001\u002Fpositive\u002Ftoo-large\u002Fcsv-tool\u002FSKILL.md",[],[],{"skillNo":116,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":101,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":18},"01M7DJ7C3VA0KQ8Q9ESNX6AJHE","https:\u002F\u002Fgithub.com\u002Fak2dev\u002Fagentguard\u002Fblob\u002Fmain\u002Ffixtures\u002Frules\u002FAG-SYS-001\u002Fnegative\u002Fsmall\u002Fcsv-tool\u002FSKILL.md",[],[],{"skillNo":121,"name":122,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":101,"licenseFileUrl":6,"sourceHtmlUrl":123,"categories":124,"keywords":125,"publishedAt":18},"01M7DJ7AQZTGY5YADQX73TRB7K","pdf","https:\u002F\u002Fgithub.com\u002Fak2dev\u002Fagentguard\u002Fblob\u002Fmain\u002Ffixtures\u002Frules\u002FAG-SKL-TYP-002\u002Fpositive\u002Fother-publisher\u002Fpdf\u002FSKILL.md",[],[],{"skillNo":127,"name":122,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":101,"licenseFileUrl":6,"sourceHtmlUrl":128,"categories":129,"keywords":130,"publishedAt":18},"01M7DJ7831XDVWS4W9SAAKBJHX","https:\u002F\u002Fgithub.com\u002Fak2dev\u002Fagentguard\u002Fblob\u002Fmain\u002Ffixtures\u002Frules\u002FAG-SKL-TYP-002\u002Fnegative\u002Fsame-publisher\u002Fpdf\u002FSKILL.md",[],[]]