Formerly known as Azure AI Services or Azure Cognitive Services is a unified collection of prebuilt AI capabilities within the Microsoft Foundry platform
Hey Bruno S M,
Good day. I will try to replicate the scenario with above context anyway.
But sharing the observation on call would have saved some time.Re-emphasizing the pointers for your reference.
Root Cause 1 — Foundry Project Endpoints Are Not DNS-Derivable
Source: Deploy and use Claude models in Microsoft Foundry — Microsoft Learn
The official docs make clear that valid endpoints follow a strict, explicit pattern — they cannot be inferred. To work with your deployed model, you need your base URL, which is of the form https://<resource name>.services.ai.azure.com/anthropic, and your target URI from your deployment details, which is of the form https://<resource name>.services.ai.azure.com/anthropic/v1/messages. Microsoft Learn
Source: Configure Claude Code for Microsoft Foundry — Microsoft Learn
The portal navigation path to retrieve the correct endpoint is also documented explicitly: To find your base URL from the Foundry portal, go to the home page of the Foundry portal, find the Project endpoint, and copy the part of the URL that comes before /api/projects/<your-project-name>. Your base URL is of the form https://<your-resource-name>.services.ai.azure.com. Microsoft Learn
This confirms that endpoint derivation from a project or resource name is not supported — the URL must be copied directly from the portal.
Root Cause 2 — Mutually Exclusive Foundry Configuration Modes
Source: Configure Claude Code for Microsoft Foundry — Microsoft Learn
The official variable table documents the two modes as alternatives, not complements: ANTHROPIC_FOUNDRY_RESOURCE sets your Foundry resource name and Claude Code constructs the endpoint URL as https://<resource-name>.services.ai.azure.com/anthropic. The alternative is ANTHROPIC_FOUNDRY_BASE_URL, which allows you to provide the full base URL directly. Microsoft Learn
The configuration block in the same document shows them as commented alternatives:
powershell
# Azure resource name (replace <your-resource-name> with your resource name)
$env:ANTHROPIC_FOUNDRY_RESOURCE = "<your-resource-name>"
# Or provide the full base URL:
# $env:ANTHROPIC_FOUNDRY_BASE_URL = "https://<your-resource-name>.services.ai.azure.com"
The # Or makes the mutual exclusivity explicit — only one should be set at a time. Bruno's integration used a project endpoint, so ANTHROPIC_FOUNDRY_BASE_URL was the correct choice, with ANTHROPIC_FOUNDRY_RESOURCE left unset.
Root Cause 3 — Model Deployment Name Ambiguity
Source: Configure Claude Code for Microsoft Foundry — Microsoft Learn
Microsoft's own documentation explicitly warns about this risk and mandates pinning: Pin specific model versions for every deployment. If you use model aliases (sonnet, opus, haiku) without pinning, Claude Code may attempt to use a newer model version that isn't available in your Foundry account, breaking existing users when Anthropic releases updates. When you create Azure deployments, select a specific model version rather than "auto-update to latest." Microsoft Learn
The recommended deployment names per role are also documented: Claude Code uses different models for different tasks — the primary model is claude-sonnet-4-6 for general coding, the fast model is claude-haiku-4-5 for quick operations like file reads and small edits, and the extended thinking model is claude-opus-4-6 for complex reasoning tasks. Microsoft Learn
Source: Deploy and use Claude models in Microsoft Foundry — Microsoft Learn
Thank you.