Best for
- Use when the user asks to create agents in Foundry, sync, deploy, register, or push agents to Foundry, update agent instructions, or scaffold the manifest and sync script for a new repository.
github/awesome-copilot/skills/foundry-agent-sync/SKILL.md
Create and synchronize prompt-based AI agents directly within Azure AI Foundry via REST API, from a local JSON manifest. Unlike scaffolding skills that only generate local code, this skill registers agents in the Foundry service itself — making them immediately available for invocation. Use when the user asks to create agents in Foundry, sync, deploy, register, or push agents to Foundry, update agent instructions, or scaffold the manifest and sync script for a new repository. Triggers: 'create a
Decision brief
Create and synchronize prompt-based AI agents directly within Azure AI Foundry via REST API, from a local JSON manifest. Unlike scaffolding skills that only generate local code, this skill registers agents in the Foundry service itself — making them immediately available for invocation.
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/github/awesome-copilot --skill "skills/foundry-agent-sync"Inspect the Agent Skill "foundry-agent-sync" from https://github.com/github/awesome-copilot/blob/9933dcad5be5caeb288cebcd370eeeb2fc2f1685/skills/foundry-agent-sync/SKILL.md at commit 9933dcad5be5caeb288cebcd370eeeb2fc2f1685. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
az account set --subscription $SubscriptionId | Out-Null $accessToken = az account get-access-token --resource https://ai.azure.com/ --query accessToken -o tsv if (-not $accessToken) { throw 'Failed to acquire Foundry access token.' }
Search the repo for foundry-agents.json. If it doesn't exist, ask the user what agents they need and create the manifest.
Search the repo for foundry-agents.json. If it doesn't exist, ask the user what agents they need and create the manifest.
Search for sync-foundry-agents.ps1 or foundry-agent-sync.sh. If missing, create the PowerShell script using the template above, adapting: - $AgentNamePrefix to match the project name - $ModelName to the user's deployed model - $ManifestPath to the actual manifest location
Ask the user for: - Foundry project endpoint - Subscription ID - Model deployment name (default: gpt-5-4) - Agent name prefix (default: repo name in kebab-case)
Permission review
The documentation includes network, browsing, or remote request actions.
$accessToken = az account get-access-token --resource https://ai.azure.com/ --query accessToken -o tsvThe documentation asks the agent to run terminal commands or scripts.
Execute the PowerShell script with the collected parameters:The documentation includes network, browsing, or remote request actions.
$token = az account get-access-token --resource https://ai.azure.com/ --query accessToken -o tsvEvidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 76/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 37,126 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Create and synchronize prompt-based AI agents directly within Azure AI Foundry via the Agent Service REST API. This skill registers agents in the Foundry service itself — making them immediately available for invocation, evaluation, and management through the Foundry portal or API. Each agent is created or updated idempotently via a named POST call, using definitions from a local JSON manifest file.
Key distinction: This skill creates agents inside AI Foundry (server-side). It does not scaffold local agent code or container images — for that, use the
microsoft-foundryskill'screatesub-skill.
The user must have:
gpt-5-4)az) authenticated with access to the Foundry projectCollect these values before proceeding:
| Value | How to get it |
|---|---|
| Foundry project endpoint | Azure Portal → AI Foundry project → Overview → Endpoint, or az resource show |
| Subscription ID | az account show --query id -o tsv |
| Model deployment name | The model name deployed in the Foundry project (e.g. gpt-5-4) |
The manifest is a JSON array where each entry defines one agent. Look for it at common paths: infra/foundry-agents.json, foundry-agents.json, or .foundry/agents.json. If none exists, scaffold one.
[
{
"useCaseId": "alert-triage",
"description": "Short description of what this agent does.",
"baseInstruction": "You are an assistant that... <system prompt for the agent>"
}
]
| Field | Required | Description |
|---|---|---|
useCaseId | Yes | Kebab-case identifier; used to build the agent name ({prefix}-{useCaseId}) |
description | Yes | Human-readable description stored as agent metadata |
baseInstruction | Yes | System prompt / base instructions for the agent |
Create or locate the sync script. The canonical path is infra/scripts/sync-foundry-agents.ps1 but adapt to the repo layout.
param(
[Parameter(Mandatory)]
[string]$SubscriptionId,
[Parameter(Mandatory)]
[string]$ProjectEndpoint,
[string]$ManifestPath = (Join-Path $PSScriptRoot '..\foundry-agents.json'),
[string]$ModelName = 'gpt-5-4',
[string]$AgentNamePrefix = 'myproject',
[string]$ApiVersion = '2025-11-15-preview'
)
$ErrorActionPreference = 'Stop'
# Optional: append a common instruction suffix to every agent
$commonSuffix = ''
az account set --subscription $SubscriptionId | Out-Null
$accessToken = az account get-access-token --resource https://ai.azure.com/ --query accessToken -o tsv
if (-not $accessToken) { throw 'Failed to acquire Foundry access token.' }
$definitions = Get-Content -Raw -Path $ManifestPath | ConvertFrom-Json
$headers = @{ Authorization = "Bearer $accessToken" }
$results = @()
foreach ($def in $definitions) {
$agentName = "$AgentNamePrefix-$($def.useCaseId)"
$instructions = if ($commonSuffix) { "$($def.baseInstruction)`n`n$commonSuffix" } else { $def.baseInstruction }
$body = @{
definition = @{ kind = 'prompt'; model = $ModelName; instructions = $instructions }
description = $def.description
metadata = @{ useCaseId = $def.useCaseId; managedBy = 'foundry-agent-sync' }
} | ConvertTo-Json -Depth 8
$uri = "$($ProjectEndpoint.TrimEnd('/'))/agents/$agentName`?api-version=$ApiVersion"
$resp = Invoke-RestMethod -Method Post -Uri $uri -Headers $headers -ContentType 'application/json' -Body $body
$version = $resp.version ?? $resp.latest_version ?? $resp.id ?? 'unknown'
Write-Host "Synced $agentName ($version)"
$results += [pscustomobject]@{ name = $agentName; version = $version }
}
$results | Format-Table -AutoSize
For automated deployment via Microsoft.Resources/deploymentScripts, use a bash script that:
az login --identity --username "$CLIENT_ID"az account get-access-token --resource https://ai.azure.com/FOUNDRY_AGENT_DEFINITIONS environment variable (JSON string){endpoint}/agents/{name}?api-version=2025-11-15-previewTo run the sync automatically during infrastructure deployment:
Load the manifest at compile time:
var agentDefinitions = loadJsonContent('foundry-agents.json')
Create a User-Assigned Managed Identity with the Azure AI User role on the Foundry project.
Create a Microsoft.Resources/deploymentScripts resource (kind AzureCLI) that:
loadTextContentGate behind a deployFoundryAgents parameter so teams can opt in/out.
Search the repo for foundry-agents.json. If it doesn't exist, ask the user what agents they need and create the manifest.
Search for sync-foundry-agents.ps1 or foundry-agent-sync.sh. If missing, create the PowerShell script using the template above, adapting:
$AgentNamePrefix to match the project name$ModelName to the user's deployed model$ManifestPath to the actual manifest locationAsk the user for:
gpt-5-4)Execute the PowerShell script with the collected parameters:
.\infra\scripts\sync-foundry-agents.ps1 `
-SubscriptionId '<sub-id>' `
-ProjectEndpoint '<endpoint>' `
-ModelName '<model>' `
-AgentNamePrefix '<prefix>'
Confirm synced agents by listing them:
$token = az account get-access-token --resource https://ai.azure.com/ --query accessToken -o tsv
$endpoint = '<project-endpoint>'
Invoke-RestMethod -Uri "$endpoint/agents?api-version=2025-11-15-preview" `
-Headers @{ Authorization = "Bearer $token" }
| Operation | Method | URL |
|---|---|---|
| Create/update agent | POST | {projectEndpoint}/agents/{agentName}?api-version=2025-11-15-preview |
| List agents | GET | {projectEndpoint}/agents?api-version=2025-11-15-preview |
| Get agent | GET | {projectEndpoint}/agents/{agentName}?api-version=2025-11-15-preview |
| Delete agent | DELETE | {projectEndpoint}/agents/{agentName}?api-version=2025-11-15-preview |
{
"definition": {
"kind": "prompt",
"model": "<deployed-model-name>",
"instructions": "<system prompt>"
},
"description": "<agent description>",
"metadata": {
"useCaseId": "<use-case-id>",
"managedBy": "foundry-agent-sync"
}
}
| Symptom | Cause | Fix |
|---|---|---|
401 Unauthorized | Token expired or wrong audience | Re-run az account get-access-token --resource https://ai.azure.com/ |
403 Forbidden | Missing Azure AI User role | Assign the role on the Foundry project scope |
404 Not Found | Wrong project endpoint | Verify endpoint includes /api/projects/{projectName} |
| Model not found | Model not deployed in project | Deploy the model in AI Foundry portal first |
| Empty definitions | Manifest path wrong | Check -ManifestPath points to the JSON file |
Alternatives
affaan-m/ECC
Production machine-learning engineering workflow for data contracts, reproducible training, model evaluation, deployment, monitoring, and rollback. Use when building, reviewing, or hardening ML systems beyond one-off notebooks.
K-Dense-AI/scientific-agent-skills
Build, inspect, test, and analyze bounded process-based discrete-event simulations with SimPy, including events, resources, interrupts, monitoring, replications, warm-up, and reproducible output analysis.
JasonColapietro/suede-creator-skills
Give a blunt A-F ship grade for a code change across correctness, security, data, UX, verification, and deploy readiness. Use for a grade, not a findings review.
event4u-app/agent-config
Use when working with Terragrunt — DRY multi-env configs, module dependencies, remote state orchestration — even when the user just says 'deploy this to staging and prod' without naming Terragrunt.