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.

Table of Contents

The Foundry Client

Credentials

Configuration Shape

Try It

Azure AI Foundry hosts model deployments behind a project. This site points an 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

Loading Monaco Editor...

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.

Loading Monaco Editor...

Configuration Shape

Everything above reads from a single bound options class:

Loading Monaco Editor...

Currently configured on this deployment:

Foundry project hostrepettidevopenai.services.ai.azure.com
Chat deploymentgpt-5.4-mini
Available models
gpt-5.6-luna
gpt-5.6-terra
gpt-5.6-sol
gpt-5.4-mini
gpt-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.

DefaultAzureCredential

The credential chain used to authenticate the Foundry project client.
An unhandled error has occurred. Reload 🗙