All skills
microsoft avatar

/microsoft-foundry

@04110d9
by microsoftmicrosoft/skills3.1k stars
351

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 create, create agent, update agent, add tool to agent, invoke agent, agent.yaml, agent insights, pull agent insights, evaluate agent, batch eval, continuous eval, continuous monitoring, agent CI/CD, optimize prompt, improve prompt, prompt optimizer, optimize agent instructions, Agent Optimizer scaffold, 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).

Use this Skill: https://skilld.dev/gh/microsoft/skills/microsoft-foundry

This session only. Nothing lands on disk.

foundry-agentcreatecreate-prompt.md

≈1.1k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Create Prompt Agent

Create and manage prompt agents in Azure Foundry Agent Service using MCP tools or Python SDK. For hosted agents (container-based), see create-hosted.md.

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

Source: SKILL.md on GitHub

2 warnings3d4 checks · Risk SAFE
  • Gen Agent Trust Hub3d

    This skill provides a comprehensive environment for managing the end-to-end lifecycle of AI agents, models, and infrastructure on Microsoft Foundry. It includes sub-skills for deployment, evaluation, fine-tuning, and troubleshooting. The skill utilizes dynamic code execution and shell command wrappers, which are used within the context of local development and cloud orchestration. All external resources and dependencies originate from trusted organizations and well-known services.

  • Socket3d

    2 alerts: gptSecurity, gptAnomaly

  • Snyk3d

    Risk: LOW · No issues

  • Runlayer7mo

    36/36 files flagged

Signed by skilld at 04110d9. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 20 hours ago.

Activeupdated last week
metadata
{
  "author": "Microsoft",
  "version": "1.2.26"
}

README badge

README badge for microsoft/skills/microsoft-foundry