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-agentinvokereferencesinvocations-protocol.md

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

Invocations Protocol Guide

The invocations protocol is bytes in, bytes out. The platform is pure pass-through — the raw HTTP request body is forwarded to the container and the raw response is returned. The agent developer defines what the container accepts and returns. Unlike responses (OpenAI-compatible with platform-managed history), invocations gives full control to the container code.

Input/Output Contract

Aspect responses invocations
Input Natural language message Raw HTTP request body from --input-file; format it as the container's invoke handler expects
Output Structured OpenAI response with output_text Raw response bytes from the container — JSON, text, or SSE events. Format is defined by the agent developer
Conversation history Platform-managed; azd can persist the conversationId for reuse Agent-managed via session filesystem
Streaming Platform-managed Agent-controlled

Discovering the Expected Input Schema

⚠️ Do not guess the invocations request body. The developer defines the schema in the container's invoke handler. The platform does not validate or transform the payload.

1. Fetch the OpenAPI Spec (Preferred)

Agents can register an OpenAPI spec that describes the expected request/response format. Fetch it from:

GET {projectEndpoint}/agents/{agentName}/endpoint/protocols/invocations/docs/openapi.json

If the developer registered an openapi_spec when creating the server, this returns the full API contract. If not registered, it returns 404.

2. Inspect Agent Source Code

Look at the agent's invoke handler — the function registered with @app.invoke_handler (Python) or equivalent. The handler reads the raw request (e.g., request.json() for JSON, request.body() for raw bytes) and returns a Response.

3. Ask the User

If neither the OpenAPI spec nor source code is available, ask the user for the expected request body format before invoking.

Examples

Responses protocol (default):

azd ai agent invoke "What is the weather in Seattle?"

Invocations protocol — agent expects {"message": "<text>"}:

azd ai agent invoke --protocol invocations --input-file request.json

Use --output raw when the unmodified status line, headers, and body are required. azd reuses the saved session automatically; use --new-session to reset agent-managed state.

Common Use Cases

Scenario Why Invocations
Webhook receiver (GitHub, Stripe, Jira) External system sends its own payload format
Non-conversational processing (classification, extraction) Input is structured data, not a chat message
Custom streaming protocol (AG-UI) Needs raw SSE control, not OpenAI-compatible streaming
Protocol bridge (proprietary systems) Caller has its own protocol that doesn't map to /responses

Error Handling

Error Cause Resolution
400/422 or invocation failed Request body does not match what the container expects Fetch OpenAPI spec or inspect handler code for the correct schema
404 on OpenAPI spec Developer did not register an openapi_spec Inspect handler source code or ask the user for the API contract
Empty response Agent returned no content Check logs with azd ai agent monitor; verify the handler processes the request body correctly

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