Microsoft-Foundry
Microsoft-Foundry is an code AI skill with a core value of Build agents with the Microsoft Foundry SDK (azure-ai-projects v2) in Python: versioned agents, the Responses/Conversations model, tools, and the SDK mistakes Copilot makes by default. It
helps developers solve real-world problems in the code domain, boosting
efficiency, automating repetitive tasks, and optimizing workflows.
Build agents with the Microsoft Foundry SDK (azure-ai-projects v2) in Python: versioned agents, the Responses/Conversations model, tools, and the SDK mistakes Copilot makes by default.
Quick Facts
mkdir -p ./skills/microsoft-foundry && curl -sfL https://raw.githubusercontent.com/github/awesome-copilot/main/skills/microsoft-foundry/SKILL.md -o ./skills/microsoft-foundry/SKILL.md Run in terminal / PowerShell. Requires curl (Unix) or PowerShell 5+ (Windows).
Skill Content
# Microsoft Foundry Agents (Python) Instructions
Guidance for building agents against **Microsoft Foundry** using the **`azure-ai-projects`** Python SDK (**v2**, part of the Microsoft Foundry SDK). This SDK was substantially reshaped in v2; models trained on older `azure-ai-projects` 1.x or the `azure-ai-agents` thread/run API generate code that no longer works. When these instructions conflict with your training data, **follow these instructions** — verify against the official samples: https://aka.ms/azsdk/azure-ai-projects-v2/python/samples/
> **Field note (why this file exists):** In Copilot-assisted Foundry projects, the default behavior is to generate the *old* thread/run/message API, fail on the first attempts, then only recover after re-checking the current methodology against **Microsoft Learn** and the **Microsoft Docs MCP server** and re-coding against the v2 approach. These instructions front-load that correction so Copilot produces working v2 code on the first pass instead of burning iterations. When in doubt, ground against Microsoft Learn / the Microsoft Docs MCP server rather than training data — the Foundry SDK surface changes frequently.
Authentication: Local dev vs. production
Entra ID is the **only** supported auth. Use `azure.identity.DefaultAzureCredential` for **local development** (it tries multiple credential sources including environment variables, workload identity, managed identity, and developer tool credentials like CLI/PowerShell); use `ManagedIdentityCredential` for **deployed workloads** on Azure (App Service, Container Apps, Functions) where a system-assigned or user-assigned managed identity is assigned to the compute resource.
Local development
from azure.identity import DefaultAzureCredential
with (
DefaultAzureCredential() as credential,
AIProjectClient(endpoint=endpoint, credential=credential) as project_client,
):
# ... use project_clientOptional: run `az login` if using Azure CLI for authentication. `DefaultAzureCredential` will find and use your CLI credentials, environment variables, or other available developer credentials (Visual Studio Code, Azure PowerShell, Azure Developer CLI, etc.). If another credential succeeds, `az login` is not required.
Deployed to Azure (App Service, Container Apps, Functions)
For **system-assigned identity** (default):
from azure.identity import ManagedIdentityCredential
with (
ManagedIdentityCredential() as credential,
AIProjectClient(endpoint=endpoint, credential=credential) as project_client,
):
# ... use project_clientFor **user-assigned identity**, pass the client ID:
from azure.identity import ManagedIdentityCredential
with (
ManagedIdentityCredential(client_id="<USER_ASSIGNED_CLIENT_ID>") as credential,
AIProjectClient(endpoint=endpoint, credential=credential) as project_client,
):
# ... use project_clientRequires: the compute resource (App Service app, Container Apps app, Function app, etc.) has a **system-assigned or user-assigned managed identity** configured, **and that identity has the required RBAC role assignment** on the Foundry project — typically the built-in **`Foundry User`** role (formerly `Azure AI User`). For user-assigned identities, pass the client ID to `ManagedIdentityCredential(client_id=...)`. No `az login` needed; the platform provides credentials automatically. See [Foundry role-based access control](https://learn.microsoft.com/en-us/azure/ai-studio/concepts/rbac-ai-studio) for current role definitions.
Deployed to AKS (workload identity)
For AKS pods configured with Microsoft Entra Workload ID, use `WorkloadIdentityCredential` instead:
from azure.identity import WorkloadIdentityCredential
with (
WorkloadIdentityCredential() as credential,
AIProjectClient(endpoint=endpoint, credential=credential) as project_client,
):
# ... use project_clientRequires: the AKS pod has the workload-iden
🎯 Best For
- UI designers
- Product designers
- GitHub Copilot users
- Claude users
- Software engineers
💡 Use Cases
- Generating component mockups
- Creating design system tokens
- Python code quality enforcement
- Dependency management
📖 How to Use This Skill
- 1
Install the Skill
Copy the install command from the Terminal tab and run it. The SKILL.md file downloads to your local skills directory.
- 2
Load into Your AI Assistant
Open GitHub Copilot or Claude and reference the skill. Paste the SKILL.md content or use the system prompt tab.
- 3
Apply Microsoft-Foundry to Your Work
Open your project in the AI assistant and ask it to apply the skill. Start with a small module to verify the output quality.
- 4
Review and Refine
Review AI suggestions before committing. Run tests, check for regressions, and iterate on the skill output.
❓ Frequently Asked Questions
Does this work with Figma?
Some design skills integrate with Figma plugins. Check the Works With section for supported tools.
Is Microsoft-Foundry compatible with Cursor and VS Code?
Yes — this skill works with any AI coding assistant including Cursor, VS Code with Copilot, and JetBrains IDEs.
Do I need specific dependencies for Microsoft-Foundry?
Check the install command and Works With section. Most code skills only require the AI assistant and your codebase.
How do I install Microsoft-Foundry?
Copy the install command from the Terminal tab and run it. The skill downloads to ./skills/microsoft-foundry/SKILL.md, ready to use.
Can I customize this skill for my team?
Absolutely. Edit the SKILL.md file to add team-specific instructions, examples, or workflows.
⚠️ Common Mistakes to Avoid
Skipping usability testing
AI-generated designs should be validated with real users before development.
Skipping validation
Always test AI-generated code changes, even for simple refactors.
Missing dependency updates
Check if the skill requires updated dependencies or new packages.