This repository acts as the top-level directory for official Azure AI Foundry documentation sample code and examples. It includes notebooks and sample code that contain end-to-end examples as well as smaller code snippets for common developer tasks.
This repository is entirely open source, guidance on how to contribute and links to additional repositories are provided below.
Use the samples in this repository to try out Azure AI Foundry scenarios on your local machine!
This repo includes a GitHub Copilot custom agent and a GitHub Actions workflow for auditing folders that can become Azure AI Foundry agents.
- Custom agent:
.github/agents/foundry-repo-auditor.agent.md - Repo skill:
.github/skills/foundry-repo-audit/SKILL.md - Workflow:
.github/workflows/foundry-repo-audit.yml - Azure MCP reference config:
.github/copilot/azure-foundry-mcp.json - Copilot coding agent setup workflow:
.github/workflows/copilot-setup-steps.yml
- The workflow runs automatically on every push to
main. - The workflow can also be started manually from the Actions tab by running Foundry Repo Audit.
- Automatic runs are report-only and upload an audit artifact instead of creating issues.
Create a repository secret named COPILOT_PAT before using the workflow.
Recommended token setup:
- token type: fine-grained personal access token
- GitHub permission: Copilot Requests
- repository access: this repository
- repository permissions: enough access to read contents and create issues
To add the secret on GitHub.com:
- Open the repository.
- Go to Settings > Secrets and variables > Actions.
- Select New repository secret.
- Name it
COPILOT_PAT. - Paste the token value and save.
To let the GitHub website coding agent or custom agent verify Foundry deployments in the cloud, finish the Azure MCP setup in GitHub:
- Open Settings > Copilot > Coding agent.
- In MCP configuration, paste the JSON from
.github/copilot/azure-foundry-mcp.json. - Open Settings > Environments and create an environment named
copilot. - Add environment variables named
AZURE_CLIENT_ID,AZURE_TENANT_ID, andAZURE_SUBSCRIPTION_ID. - Run the copilot-setup-steps workflow once from the Actions tab to validate Azure login for Copilot coding agent sessions.
This repo now includes agent-level Azure MCP configuration in .github/agents/foundry-repo-auditor.agent.md, but the GitHub website experience still depends on the repository Copilot environment being configured correctly.
- Open the repository on GitHub.
- Select the Actions tab.
- Choose Foundry Repo Audit from the workflow list.
- Select Run workflow.
- If you want the run to create GitHub issues, enable the
create_issuesoption. - Start the workflow and then open the run summary to review logs and download the
foundry-repo-audit-reportartifact.
Found a bug or have a suggestion? Open an issue — we welcome feedback from everyone!
Sample contributions are submitted through a private staging repository. If you're a Microsoft employee or contractor, see the contributing guidelines for how to get started.