Claude Code on Microsoft Foundry Setup
Configure Claude Code on Microsoft Foundry: Azure auth, idle timeouts, auto mode opt-in, PowerShell tool defaults, and third-party provider messaging.
Open the source and read safety notes before installing.
Safety notes
- Foundry credentials in CI should use federated workload identity—not checked-in client secrets.
- Auto mode requires `CLAUDE_CODE_ENABLE_AUTO_MODE=1` on third-party providers.
- PowerShell tool is enabled by default on Windows for Foundry users unless `CLAUDE_CODE_USE_POWERSHELL_TOOL=0`.
Privacy notes
- Prompts stay within Azure boundary subject to your logging and diagnostic settings.
- Welcome banner shows provider name instead of API Usage Billing on third-party providers.
- Telemetry tips pointing at first-party surfaces are suppressed on Foundry deployments.
Prerequisites
- Azure Foundry or Azure AI project with Anthropic model deployment access.
- Azure AD app, managed identity, or key-based auth approved by security.
- Regional endpoint and deployment names documented for the team.
- Windows developers identified if PowerShell tool defaults apply.
Schema details
- Install type
- copy
- Reading time
- 8 min
- Difficulty score
- 58
- Troubleshooting
- Yes
- Breaking changes
- No
- Scope
- Source repo
Full copyable content
Use this guide to connect Claude Code to Microsoft Foundry with Azure authentication and correct model selection.About this resource
TL;DR
Microsoft Foundry connects Claude Code to Azure-hosted Anthropic models with Azure AD authentication. Configure deployments and regions, opt into auto mode explicitly, and review PowerShell tool defaults on Windows engineering laptops.
Prerequisites & Requirements
- {"task": "Claude Code installed", "description": "Latest approved build is available on the target machine"}
- {"task": "Credentials ready", "description": "Login, API key, or provider credentials match the workflow"}
- {"task": "Test environment prepared", "description": "A disposable project or sandbox can validate the setup"}
- {"task": "Team policy reviewed", "description": "Managed settings and MCP policy align with org requirements"}
- {"task": "Rollback documented", "description": "Steps to disable or revert the integration are written down"}
Core Concepts Explained
Third-party provider session
Foundry sessions use provider-specific auth and show the provider name in /status instead of first-party billing labels.
Shared timeout behavior
Foundry shares Vertex idle timeout defaults and API_FORCE_IDLE_TIMEOUT opt-out semantics.
Auto mode opt-in
Set CLAUDE_CODE_ENABLE_AUTO_MODE=1 for Opus auto mode on Foundry as with other third-party providers.
Windows PowerShell tool
PowerShell tool defaults on for Bedrock, Vertex, and Foundry on Windows unless explicitly disabled.
Step-by-Step Implementation Guide
Provision deployment. Create Foundry deployment with required Anthropic model and capacity.
Configure Azure auth. Set up managed identity or service principal per Azure AI guidance.
Export env vars. Map endpoint, deployment, and tenant variables documented for Claude Code Foundry.
Verify /status. Confirm provider shows Microsoft Foundry and models list expected deployments.
Enable auto mode optionally. Export
CLAUDE_CODE_ENABLE_AUTO_MODE=1if teams want auto mode on Opus 4.7/4.8.Tune PowerShell on Windows. Set
CLAUDE_CODE_USE_POWERSHELL_TOOL=0if bash-only workflows are required.Test streaming tools. Streaming tool execution is always enabled on Foundry—including when telemetry is off.
Publish runbook. Document Azure quota escalation and Foundry-specific support contacts.
Foundry Setup Checklist
- {"task": "Deployment live", "description": "Model deployment accepts test prompts"}
- {"task": "Auth configured", "description": "Managed identity or SP works on dev machines"}
- {"task": "Status correct", "description": "/status shows Foundry provider"}
- {"task": "Auto mode decision", "description": "CLAUDE_CODE_ENABLE_AUTO_MODE set if wanted"}
- {"task": "Windows tools reviewed", "description": "PowerShell default acknowledged on Windows"}
Operational Guardrails
- Pin Claude Code or Agent SDK versions in team docs and CI images before rolling out
integration-specific flags such as
--remote-control,--chrome, or provider env vars. - Run a five-minute smoke test on a disposable profile after managed settings or MCP policy changes—do not wait for user reports to discover blocked servers.
- Capture
/statusoutput and relevant env sources when escalating provider or transport issues; recent builds expose more provider and region diagnostics. - Revisit allowlists and OAuth scopes after major
CHANGELOG.mdMCP or auth fixes; enforcement timing changes often require client upgrades, not just policy edits. - Document rollback: which env vars to unset, which MCP entries to remove, and who can publish emergency managed-settings overrides.
Troubleshooting
Login policy blocks Foundry
Ensure forceLoginOrgUUID managed settings do not block third-party provider sessions.
Auto mode message confusing
Follow CLAUDE_CODE_ENABLE_AUTO_MODE opt-in docs rather than first-party assumptions.
Unexpected PowerShell prompts
Disable with CLAUDE_CODE_USE_POWERSHELL_TOOL=0 on Windows if undesired.
Stream hangs
Check API_FORCE_IDLE_TIMEOUT for long-running tool calls.
Source Verification Notes
Verified against the public anthropics/claude-code repository README,
plugins/README.md, and CHANGELOG.md on 2026-06-14:
CHANGELOG.mdenables auto mode on Foundry withCLAUDE_CODE_ENABLE_AUTO_MODE=1for Opus 4.7/4.8.CHANGELOG.mdrestored five-minute idle timeout on Foundry/Vertex unlessAPI_FORCE_IDLE_TIMEOUT=0.CHANGELOG.mdenables PowerShell tool by default on Windows for Foundry, Vertex, and Bedrock.CHANGELOG.mdshows provider name instead of API Usage Billing on third-party providers.CHANGELOG.mdfixedforceLoginOrgUUIDblocking Bedrock, Vertex, and Foundry alongside org pin.
Duplicate Check
This guide covers Microsoft Foundry provider setup. It complements claude-code-on-google-vertex-ai-setup.mdx and claude-code-on-amazon-bedrock-setup.mdx for multi-cloud standards.
References
- Microsoft Foundry - https://code.claude.com/docs/en/microsoft-foundry
- Google Vertex AI setup - claude-code-on-google-vertex-ai-setup
- Amazon Bedrock setup - claude-code-on-amazon-bedrock-setup
Source citations
Add this badge to your README
Show that Claude Code on Microsoft Foundry Setup is listed on HeyClaude. Paste this Markdown into your README — it renders the badge and links back to this page.
[](https://heyclau.de/entry/guides/claude-code-on-microsoft-foundry-setup)Signals
Loading live community signals…
A short, calm digest of reviewed Claude resources. Unsubscribe any time.