To open and configure Claude with Microsoft Foundry, use the product’s own configuration flows rather than Windows account settings.
For Claude Code (CLI and VS Code extension):
- Ensure Claude Code is installed and configured for Microsoft Foundry.
- To validate configuration and see current settings, open a terminal in a project folder and run:
claude - At the Claude prompt, run:
This shows key settings such as:/status- API provider (should be
Microsoft Foundry) - Foundry resource name
- Default model (for example,
claude-sonnet-4-6)
- API provider (should be
- If there are errors like authorization failures or missing models, use the troubleshooting guidance:
- For 401/403, run
az loginagain or verify theANTHROPIC_FOUNDRY_API_KEYvalue. - If models are not found, confirm
ANTHROPIC_FOUNDRY_RESOURCEand anyANTHROPIC_DEFAULT_*_MODELvalues match the deployment names. - If Claude prompts for Anthropic login instead of Foundry, ensure
CLAUDE_CODE_USE_FOUNDRY=1is set before starting Claude.
- For 401/403, run
For Claude Code VS Code extension settings:
- In VS Code, open Settings (Ctrl+, or Cmd+,).
- Search for
Claude Code: Environment Variables. - Select Edit in settings.json and configure:
{ "Claude Code: Environment Variables": { "CLAUDE_CODE_USE_FOUNDRY": "1", "ANTHROPIC_FOUNDRY_RESOURCE": "<your-resource-name>", "ANTHROPIC_FOUNDRY_API_KEY": "<optional-for-non-entra-auth>" } } - Restart VS Code (preferably launched from a terminal where the environment variables are set) and open the Claude Code panel via the spark icon in the sidebar.
For Claude Desktop with Microsoft Foundry:
- Open Claude Desktop.
- Go to Help > Troubleshooting > Enable Developer Mode.
- Then go to Developer > Configure third-party inference.
- In the configuration window:
- Select Connection.
- Choose Foundry as the inference provider.
- Enter the Foundry resource name and API key.
- Add the Foundry model deployment names (first in the list becomes the default model).
- Select Apply locally; Claude Desktop restarts in 3P mode.
- On the sign-in screen, choose Start in Cowork on 3P to use Claude with the Foundry deployment.
If settings still do not open or work as expected, verify prerequisites:
- A supported paid Azure subscription type.
- Access to Microsoft Foundry and a Foundry resource with Claude models deployed.
- A valid Foundry project API key when using API-key-based configuration.
References: