[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M74PRJZ924HEM9BA155ACM3D":3,"skill-same:01M74PRJZ924HEM9BA155ACM3D":96},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":28,"commitSha":29,"skillDirectory":5,"forksCount":14,"repositoryHtmlUrl":30,"repositoryHomepageUrl":6,"ownerHtmlUrl":31,"ownerBlogUrl":32,"ownerDescription":6,"updatedAt":33,"install":34,"resources":47},"01M74PRJZ924HEM9BA155ACM3D","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.","SamuelChien\u002Fmega-skills-collection","SamuelChien","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F4652114?v=4","01M74KK34WVHA0P5ZYSJRDDFMG","Samuel Chien","01M74KK35FQN1N9VZ9EPTH3P2S",0,"MIT","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fazure-ai-projects-py\u002FSKILL.md",[],[],"2026-11-11 15:11:14",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(require_envvar=True)\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 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(require_envvar=True)\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 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":15,"metadata":24,"description":7},{"author":25,"package":26,"version":27},"Microsoft","azure-ai-projects","1.0.0","main","c2b1fdccc779e99ac814e55fb69ca8d71215dd0f","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection","https:\u002F\u002Fgithub.com\u002FSamuelChien","http:\u002F\u002Fsamuelchien.com\u002F","2026-05-26 08:27:14",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add SamuelChien\u002Fmega-skills-collection --skill azure-ai-projects-py",{"tool":40,"command":41},"bunx","bunx skills add SamuelChien\u002Fmega-skills-collection --skill azure-ai-projects-py",{"tool":43,"command":44},"pnpm","pnpm dlx skills add SamuelChien\u002Fmega-skills-collection --skill azure-ai-projects-py","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fazure-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","参考文档",6862,"https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fazure-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\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fazure-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\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fazure-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\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fazure-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\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fazure-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\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fazure-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\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fazure-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\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fazure-ai-projects-py\u002Freferences\u002Fdeployments.md",{"path":83,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":84,"sourceHtmlUrl":85},"references\u002Fevaluation.md",10975,"https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fazure-ai-projects-py\u002Freferences\u002Fevaluation.md",{"path":87,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":88,"sourceHtmlUrl":89},"references\u002Ftools.md",12016,"https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fazure-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\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fazure-ai-projects-py\u002Fscripts\u002Frun_batch_evaluation.py",[97,105,112,119,126,134],{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":104},"01M76R4WZQZAXGGXMQCA0FZ716","zustand-store-ts","Create Zustand stores with TypeScript, subscribeWithSelector middleware, and proper state\u002Faction separation. Use when building React state management, creating global stores, or implementing reactive state patterns with Zustand.","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fzustand-store-ts\u002FSKILL.md",[],[],"2026-11-12 13:55:43",{"skillNo":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":104},"01M76R4T9KENDH7FENGZQHBW4G","zustand-store-creator","Zustand Store Creator - Auto-activating skill for Frontend Development.\nTriggers on: zustand store creator, zustand store creator\nPart of the Frontend Development skill category.","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fzustand-store-creator\u002FSKILL.md",[],[],{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":116,"categories":117,"keywords":118,"publishedAt":104},"01M76R3YWN84B7SANJ52X799ZE","zero-trust-config-helper","Zero Trust Config Helper - Auto-activating skill for Security Advanced.\nTriggers on: zero trust config helper, zero trust config helper\nPart of the Security Advanced skill category.","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fzero-trust-config-helper\u002FSKILL.md",[],[],{"skillNo":120,"name":121,"nameZh":6,"description":122,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":123,"categories":124,"keywords":125,"publishedAt":104},"01M76R3HNSV2AEYSKHM915GJ58","zapier-integration-helper","Zapier Integration Helper - Auto-activating skill for Business Automation.\nTriggers on: zapier integration helper, zapier integration helper\nPart of the Business Automation skill category.","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fzapier-integration-helper\u002FSKILL.md",[],[],{"skillNo":127,"name":128,"nameZh":6,"description":129,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":130,"licenseFileUrl":6,"sourceHtmlUrl":131,"categories":132,"keywords":133,"publishedAt":104},"01M76R3DJSKAT4FA7DV4BF3GCE","zai-cli","Execute z.AI CLI providing vision, search, reader, and GitHub exploration via CLI and MCP.\nUse when user needs image\u002Fvideo analysis, OCR, UI-to-code conversion, error diagnosis,\nreal-time web search, web page to markdown extraction, or GitHub code exploration.\nTrigger with phrases like \"analyze this image\", \"search the web for\", \"read this page\",\n\"explore this repo\", or \"use zai\". Requires Z_AI_API_KEY.","Apache-2.0","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fzai-cli\u002FSKILL.md",[],[],{"skillNo":135,"name":136,"nameZh":6,"description":137,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":138,"categories":139,"keywords":140,"publishedAt":104},"01M76R2KAM699XE9AJVAWE4H2E","yt-research","Research competitor YouTube channels, niches, and trending topics for your content strategy.\nUse this skill whenever the user says \"research channels\", \"analyze competitors\", \"find trending topics\",\n\"niche analysis\", \"competitive research\", \"what are other creators doing\", \"scrape YouTube channels\",\nor wants to understand the competitive landscape for a specific tool or topic area. Use when working with yt research. Trigger with 'yt', 'research'.","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fyt-research\u002FSKILL.md",[],[]]