Agent Framework: Azure AI Foundry Integration
How this site's AIAgent is actually backed by an Azure AI Foundry project, and what that buys you.
Contents
Azure.AI.Projects.AIProjectClient at that project's endpoint and calls
.AsAIAgent(model, name, instructions) to get back a plain AIAgent - Foundry only
shows up at registration time, not in any code that actually uses the agent.
The Foundry client
Credentials
Auth is DefaultAzureCredential, with one dev-time carve-out: on some dev machines the
managed-identity IMDS probe doesn't fail fast, it just retries until it times out - which blocks
DefaultAzureCredential from ever reaching the az-login/Visual Studio credential that
actually works locally. So in Development, managed identity is excluded from the chain; in
Production the full chain is used so hosted managed identity works as expected.
Configuration shape
Everything above reads from a single bound options class:
Currently configured on this deployment
| Foundry project host | repettinet-ai-eus2.services.ai.azure.com |
|---|---|
| Chat deployment | gpt-5.4-mini |
| Available models | gpt-5.6-lunagpt-5.6-terragpt-5.6-solgpt-5.4-minigpt-4o-mini |
Try it: a real Foundry round-trip
This calls IChatService.ChatStreamAsync (the same streaming API the
Azure AI chat bot example uses) against the
deployment configured above, and shows the token usage Foundry reports back for the turn.
References
For more detailed information and advanced scenarios, check out these helpful resources:
- What is Azure AI Foundry?Overview of Foundry projects, deployments, and the Foundry SDKs.
- DefaultAzureCredentialThe credential chain used to authenticate the Foundry project client.