Azure AI Foundry Support #
What: Claude Code now supports connecting to Claude models deployed on Azure AI Foundry with Azure AD token authentication
How to use:
# Enable Foundry mode
export CLAUDE_CODE_USE_FOUNDRY=true
# Option 1: Use API key authentication
export ANTHROPIC_FOUNDRY_API_KEY=your-api-key
export ANTHROPIC_FOUNDRY_BASE_URL=https://your-resource.services.ai.azure.com/anthropic/
# Option 2: Use resource name (automatically constructs URL)
export ANTHROPIC_FOUNDRY_RESOURCE=your-resource-name
# Option 3: Use Azure AD authentication (no API key needed)
# Azure AD token provider is automatically configured
Details:
- Supports both API key and Azure AD token provider authentication methods
- Can specify either a full
baseURLor aresourcename (which constructs the Azure services URL automatically) - Azure AD authentication uses the
https://cognitiveservices.azure.com/.defaultscope - For testing/debugging, you can skip authentication with
CLAUDE_CODE_SKIP_FOUNDRY_AUTH=true - Foundry deployments are now recognized as a first-party environment alongside standard Anthropic deployments
- Evidence:
dsA class at line 202345, Foundry client initialization inxw() at line 243262, environment detection viaj3() at line 86382