AgentSkillsCN

foundry-agent-platform

部署、编排微软 Foundry 代理,并探索云原生 AI 服务的典型模式。

SKILL.md
--- frontmatter
name: "foundry-agent-platform"
description: "Microsoft Foundry agent deployment, orchestration, and cloud-native AI service patterns"

Foundry Agent Platform Skill

Deploy, orchestrate, and manage AI agents on Microsoft Foundry — the unified Azure PaaS for enterprise AI.

Rapid Evolution Domain

Foundry is in active preview (February 2026). SDK versions change frequently.

Refresh triggers:

  • azure-ai-projects SDK version bump (currently 2.0.0b3)
  • Foundry portal feature releases
  • Hosted Agents GA
  • Memory API changes

Last validated: February 2026


Platform Overview

Microsoft Foundry (formerly Azure AI Foundry) unifies model hosting, agent orchestration, tool management, observability, and multi-channel publishing.

ConceptDescription
Portalhttps://ai.azure.com
Endpointhttps://<resource>.services.ai.azure.com/api/projects/<project>
MCP Serverhttps://mcp.ai.azure.com (cloud-hosted, Entra ID)
VS Code ExtensionTeamsDevApp.vscode-ai-foundry
Key DistinctionInfrastructure platform (backend), not a surface

Foundry vs Other Platforms

AspectVS Code ExtensionM365 CopilotFoundry
TypeIDE pluginDeclarative agentCloud PaaS
RuntimeDesktop appM365 cloudAzure managed
UsersSingle developerSingle userMulti-user
AvailabilityWhen IDE openWhen M365 openAlways-on (24/7)
MemoryFile-based synapsesOneDrivePlatform-managed
ToolsMCP (manual config)Web/SP/Graph1,400+ catalog
Agents.agent.md filesSingle agentMulti-agent fleet
ObservabilityManualNoneFull OpenTelemetry

Four SDK Types

This is the most common source of confusion. Foundry has four distinct SDK types, each with different endpoints and use cases:

SDKEndpointWhen to Use
Foundry SDK.services.ai.azure.com/api/projects/Agent management, evaluations, deployments
OpenAI SDK.openai.azure.com/openai/v1Chat completions, embeddings (OpenAI-compatible)
Foundry Tools SDKsService-specificSpeech, Vision, Language, Search, etc.
Agent FrameworkFramework-specificMulti-agent orchestration (cloud-agnostic)

SDK Packages

LanguageFoundry SDKOpenAI SDK
Pythonazure-ai-projects>=2.0.0b3 (use --pre)openai
C#Azure.AI.Projects (preview)Azure.AI.OpenAI
JS/TS@azure/ai-projects (beta)openai
Javacom.azure:azure-ai-projects (preview)

Breaking Change: Python 2.x is incompatible with 1.x. The 2.x uses .services.ai.azure.com endpoints.


Agent Service Patterns

Create Agent

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

client = AIProjectClient(
    endpoint="https://<resource>.services.ai.azure.com/api/projects/<project>",
    credential=DefaultAzureCredential()
)

agent = client.agents.create_agent(
    model="gpt-4.1-mini",
    name="my-agent",
    instructions="System prompt here."
)

Versioned Agents

python
from azure.ai.projects.models import PromptAgentDefinition

definition = PromptAgentDefinition(
    model="gpt-4.1-mini",
    instructions="System prompt",
    tools=[bing_tool, file_search_tool]
)

version = client.agents.create_agent_version(
    agent_id=agent.id,
    definition=definition
)

Conversations (Multi-Turn)

python
conversation = client.agents.create_conversation(agent_id=agent.id)

client.agents.create_message(
    conversation_id=conversation.id,
    role="user",
    content="Hello"
)

run = client.agents.create_run(
    conversation_id=conversation.id,
    agent_id=agent.id
)

Key Concepts

ConceptMeaning
AgentStateless definition (model + instructions + tools)
ConversationStateful multi-turn context
RunSingle execution within a conversation
VersionImmutable snapshot of agent definition

Tool Categories

ToolUse CaseSetup
Bing GroundingReal-time web searchBing Search resource
File SearchRAG over documents (vector stores)Upload files → vector store
Code InterpreterPython sandbox executionAutomatic
SharePointEnterprise document groundingSP site + permissions
OpenAPIAny REST API via specProvide spec + auth
MCP ServersRemote Model Context ProtocolServer URL + auth
A2AAgent-to-Agent communicationTarget URL + auth

File Search Setup

python
vector_store = client.agents.create_vector_store(name="knowledge")
client.agents.upload_file_and_poll(
    vector_store_id=vector_store.id,
    file_path="skills.pdf"
)
file_search_tool = FileSearchTool(vector_store_ids=[vector_store.id])

Memory & Foundry IQ

FeatureDescription
MemoryCross-session context retention, per-user, automatic
Foundry IQEnterprise knowledge base with citations + web grounding
Priority ChainInstructions → IQ → File Search → Tool results → Training data

Memory is the cloud-native equivalent of Alex's synapse architecture — automatic, persistent, cross-surface.


Hosted Agents (Preview)

Containerized agents on managed infrastructure:

bash
pip install azure-ai-agentserver-agentframework
agentserver run --interactive   # local test
agentserver run                 # container mode (port 8080)
azd deploy                      # deploy to Foundry

Supports any framework: LangGraph, MS Agent Framework, Semantic Kernel, custom.


Observability Stack

code
Agent → OpenTelemetry → Application Insights → Agent Dashboard
python
from azure.ai.agentserver import setup_observability
setup_observability(vs_code_extension_port=4319)  # local dev

Built-in Evaluators

Relevance, Groundedness, Coherence, Safety, F1, BLEU, ROUGE


Publishing Channels

One agent, many surfaces:

ChannelTransport
M365 CopilotTeams manifest + Entra app
TeamsBot Framework
BizChatVia M365 publish
Web PreviewAuto-generated URL
REST APIStandard HTTP
ContainerDocker (Hosted Agent)

Realtime API (Voice)

TransportLatencyUse Case
WebRTC~100msBrowser voice
WebSocket~200msServer-side
SIPVariesTelephony

Models: gpt-realtime (GA), gpt-realtime-mini (GA). Supports MCP tools during voice sessions, semantic VAD, image input. 30-min session limit, PCM16 mono 24kHz.


Authentication

python
from azure.identity import DefaultAzureCredential
credential = DefaultAzureCredential()  # Keyless (recommended)
client = AIProjectClient(endpoint=endpoint, credential=credential)
RBAC RoleScope
Azure AI UserLeast privilege — call agents, use models
Azure AI OwnerCreate/manage agents, deploy models
ContributorCreate Foundry projects and resources

Anti-Patterns

Anti-PatternWhy It FailsInstead
Using Python SDK 1.x with 2.x docsIncompatible APIs, wrong endpointsAlways install --pre for 2.x
Treating Foundry as "just another heir"It's a backend, not a surfaceDesign as shared infrastructure
Hardcoding API keysSecurity risk, doesn't scaleUse DefaultAzureCredential
One giant agentContext overload, poor routingMulti-agent with orchestrator
Skipping evaluationNo quality baselineRun evaluators before shipping
Ignoring costPay-per-use can surpriseUse efficient models (4.1-mini) for most agents

Decision Checklist

When designing a Foundry-based agent:

  • Which SDK type? (Foundry SDK for agents, OpenAI SDK for completions)
  • Which model tier? (Premium for orchestrator, efficient for specialists)
  • Agent Service or Hosted Agent? (Start with Agent Service; migrate later)
  • What tools? (Bing, File Search, Code Interpreter, MCP, OpenAPI)
  • Memory strategy? (Foundry Memory, File Search, or hybrid)
  • Publishing targets? (API first, then Teams, then Web, then Voice)
  • Evaluation plan? (Which evaluators, what dataset, what baseline)
  • Auth model? (Entra ID keyless via DefaultAzureCredential)

Synapses

  • [.github/skills/ai-agent-design/SKILL.md] (Critical, Implements, Bidirectional) - "Foundry is the runtime for agent design patterns"
  • [.github/skills/multi-agent-orchestration/SKILL.md] (Critical, Implements, Bidirectional) - "Foundry Agent Service enables multi-agent orchestration at scale"
  • [.github/skills/azure-architecture-patterns/SKILL.md] (High, Extends, Bidirectional) - "Foundry is an Azure PaaS that follows WAF principles"
  • [.github/skills/mcp-development/SKILL.md] (High, Complements, Bidirectional) - "Foundry supports MCP servers as agent tools"
  • [.github/skills/enterprise-integration/SKILL.md] (High, Enables, Forward) - "Foundry provides enterprise-grade agent deployment"
  • [.github/instructions/meditation.instructions.md] (Medium, Created-During, Forward) - "Skill created during platform expansion meditation"

Microsoft Foundry Agent Platform — cloud-native agent deployment for the Alex ecosystem