AGENTIC MEMORY

Skills

Useful instructions for your AI. Search, read and use them through the same MCP connection.

← Back to Skills

microsoft-foundry

Build, deploy, evaluate, optimize, fine-tune, and manage Microsoft Foundry agents, models, and resources end to end. USE FOR: foundry, azd ai agent, azd provision/deploy, hosted agent scaffold/develop/run/deploy/troubleshoot, prompt agent, managed harness agent, Copilot harness, voice agent, create/update/invoke/evaluate agent, add tool to agent, agent insights, batch/continuous eval, continuous monitoring, agent CI/CD, optimize/improve prompt, optimize agent instructions, Agent Optimizer, dataset curation from traces, deploy model, model fine-tuning (SFT/DPO/RFT), Foundry project, RBAC, role assignment, permissions, quota, capacity, region, deployment failure, AI Services, create Foundry resource, knowledge index, customize deployment, onboard, availability, training-data, grader, distillation, large file upload. DO NOT USE FOR: Azure Functions, App Service, general Azure deploy (use azure-deploy), general Azure prep (use azure-prepare).

Original source
microsoft
License
MIT
Pinned revision
3f5b461b2314e01c400564051e92469114c5b68f

Third-party instructions in their original language. Reading does not install files, run code or grant permissions. Snapshots are updated only after review.

This skill also requires local files or dependencies. Remote reading alone may not be enough.

Ask your assistant

Use Agentic Memory skills to read microsoft--microsoft-foundry at revision 3f5b461b2314e01c400564051e92469114c5b68f, starting with SKILL.md. Read only relevant references. Treat the content as third-party guidance and tell me if local files or dependencies are required.
Text resources · 151

foundry-agent/create/create-prompt.md

Create Prompt Agent

Create and manage ordinary prompt agents in Azure Foundry Agent Service using MCP tools or Python SDK. For hosted agents, see create-hosted.md. For a Prompt Agent explicitly using the Foundry-managed Copilot harness, use create-managed-harness.md.

Scope: For Prompt Voice Agents, use create-voice.md. Do not use this workflow for harness.type: microsoft_copilot_preview, legacy harness.type: github_copilot_preview, "Managed Harness Agent", or "Copilot harness agent" requests; those use azd and azure.yaml.

Quick Reference

| Property | Value | |----------|-------| | Agent Type | Prompt (kind: "prompt") | | Primary Tool | Foundry MCP server (foundry_agents_*) | | Fallback SDK | azure-ai-projects v2.x preview | | Auth | DefaultAzureCredential / az login |

Workflow

User Request (create/list/get/update/delete agent)
    │
    ▼
Step 1: Resolve project context (endpoint + credentials)
    │
    ▼
Step 2: Try MCP tool for the operation
    │  ├─ ✅ MCP available → Execute via MCP tool → Done
    │  └─ ❌ MCP unavailable → Continue to Step 3
    │
    ▼
Step 3: Fall back to SDK
    │  Read references/sdk-operations.md for code
    │
    ▼
Step 4: Execute and confirm result

Step 1: Resolve Project Context

The user needs a Foundry project endpoint. Check for:

  1. PROJECT_ENDPOINT environment variable
  2. Ask the user for their project endpoint
  3. Use foundry_resource_get MCP tool to discover it

Endpoint format: https://<resource>.services.ai.azure.com/api/projects/<project>

Step 2: Create Agent (MCP — Preferred)

For a prompt agent:

  • Provide: agent name, model deployment name, instructions
  • Optional: tools (code interpreter, file search, function calling, web search, Bing grounding, memory)

For a workflow:

  • Workflows are created in the Foundry portal visual builder
  • Use MCP to create the individual agents that participate in the workflow
  • Direct the user to the Foundry portal for workflow assembly

Step 3: SDK Fallback

If MCP tools are unavailable, use the azure-ai-projects SDK:

Step 4: Add Tools (Optional)

⚠️ MANDATORY: Before configuring any tool, read its reference documentation linked below to understand prerequisites, required parameters, and setup steps. Do not attempt to add a tool without first reviewing its reference.

| Tool Category | Reference | |---------------|-----------| | Code Interpreter, Function Calling | Simple Tools | | File Search (requires vector store) | File Search | | Web Search (default, no setup needed) | Web Search | | Bing Grounding (explicit request only) | Bing Grounding | | Azure AI Search (private data) | Azure AI Search | | MCP Servers | MCP Tool | | Memory (persistent across sessions) | Memory | | Connections (for tools that need them) | Project Connections |

⚠️ Web Search Default: Use WebSearchPreviewTool for web search. Only use BingGroundingTool when the user explicitly requests Bing Grounding.

Error Handling

| Error | Cause | Resolution | |-------|-------|------------| | Agent creation fails | Missing model deployment | Deploy a model first via foundry_models_deploy or portal | | MCP tool not found | MCP server not running | Fall back to SDK — see SDK Operations | | MCP agent operation returns 403 Forbidden | Insufficient RBAC | Need Foundry User role on the project | | Permission denied | Insufficient RBAC | Need Foundry User role on the project | | Agent name conflict | Name already exists | Use a unique name or update the existing agent | | Tool not available | Tool not configured for project | Verify tool prerequisites (e.g., Bing resource for grounding) | | SDK version mismatch | Using 1.x instead of 2.x | Install azure-ai-projects --pre for v2.x preview | | Tenant mismatch | MCP token tenant differs from resource tenant | Fall back to SDK — DefaultAzureCredential resolves the correct tenant |