Answer: Claude Code supports three authentication methods for Microsoft Foundry: an API key set as ANTHROPIC_FOUNDRY_API_KEY, Microsoft Entra ID via the Azure SDK default credential chain, or a bearer token passed in ANTHROPIC_FOUNDRY_AUTH_TOKEN. Status: Confirmed Entry: tool/claude-code/permissions-and-security/foundry-azure-credentials Revision: 3 Digest: sha256:4ebbcb67cca23cd4 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:04:41Z Last changed: 2026-11-17T12:27:37Z (Bearer token method: — → ANTHROPIC_FOUNDRY_AUTH_TOKEN) Last verified: 2026-11-20T12:22:11Z Next check: 2026-11-21T12:22:11Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of API key method | ANTHROPIC_FOUNDRY_API_KEY | [1] | 2026-11-20 Microsoft Entra ID method | default credential chain | [1] | 2026-11-20 Bearer token method | ANTHROPIC_FOUNDRY_AUTH_TOKEN | [1] | 2026-11-20 Bearer token header | Authorization: Bearer | [1] | 2026-11-20 Precedence | ANTHROPIC_FOUNDRY_AUTH_TOKEN | [1] | 2026-11-20 Sources: [1] Anthropic. "Claude Code on Microsoft Foundry". https://code.claude.com/docs/en/microsoft-foundry.md Role: primary. Accessed: 2026-11-20T12:22:11Z Quote: "you copy a key from the Microsoft Foundry portal and set it as `ANTHROPIC_FOUNDRY_API_KEY`" (Supports: API key method) Quote: "Claude Code gets tokens through the Azure SDK default credential chain" (Supports: Microsoft Entra ID method) Quote: "another process obtains a Microsoft Entra ID access token and you pass it in `ANTHROPIC_FOUNDRY_AUTH_TOKEN`" (Supports: Bearer token method) Quote: "Claude Code sends the value of `ANTHROPIC_FOUNDRY_AUTH_TOKEN` on every request as the `Authorization: Bearer` header." (Supports: Bearer token header) Quote: "`ANTHROPIC_FOUNDRY_AUTH_TOKEN` takes precedence over `ANTHROPIC_FOUNDRY_API_KEY` and over the default credential chain." (Supports: Precedence) Published: 2026-11-20T10:36:07Z Snapshot SHA-256: 6880acc75e13a7f03c8092103ce89d8795215df081b704be7e7587d54a9c8289 (captured 2026-11-17T12:27:36Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-17T12:27:37Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T12:22:11Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:22:11Z Last attempt: 2026-11-20T12:22:11Z Notes and limitations: Extracted automatically from a single official source (section "2. Configure Azure credentials"). Related: https://latestn.com/tool/claude-code/permissions-and-security/gate-inbound-messages How do I gate inbound messages in a Claude Code channel to only trusted senders? https://latestn.com/tool/claude-code/permissions-and-security/hold-tool-call-for-user How do I make a Claude Code mod hook hold a tool call until the user decides? https://latestn.com/tool/claude-code/permissions-and-security/iam-configuration What IAM permissions does Claude Code need on Google Cloud's Agent Platform? https://latestn.com/tool/claude-code/permissions-and-security/enable-sandboxed-bash How do I enable the sandboxed Bash tool in Claude Code and confirm commands run inside the sandbox? https://latestn.com/tool/claude-code/permissions-and-security/enforce-policies What policies and restrictions can I enforce on Claude Code for my organization? https://latestn.com/tool/claude-code/permissions-and-security/filesystem-configuration How do I configure filesystem access and writable locations for a Claude Code deployment? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-17T12:27:37Z | changed | Bearer token method: — → ANTHROPIC_FOUNDRY_AUTH_TOKEN | [1] 2026-11-17T12:27:37Z | changed | API key method: — → ANTHROPIC_FOUNDRY_API_KEY | [1] 2026-11-17T12:27:37Z | changed | Bearer token environment variable: ANTHROPIC_FOUNDRY_AUTH_TOKEN → — | [1] 2026-11-17T12:27:37Z | changed | API key environment variable: ANTHROPIC_FOUNDRY_API_KEY → — | [1] 2026-11-16T12:10:12Z | changed | Bearer token environment variable: — → ANTHROPIC_FOUNDRY_AUTH_TOKEN | [1] 2026-11-16T12:10:12Z | changed | API key environment variable: — → ANTHROPIC_FOUNDRY_API_KEY | [1] 2026-11-16T12:10:12Z | changed | Bearer token variable: ANTHROPIC_FOUNDRY_AUTH_TOKEN → — | [1] 2026-11-16T12:10:12Z | changed | API key variable: ANTHROPIC_FOUNDRY_API_KEY → — | [1] 2026-11-13T03:04:41Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/claude-code/permissions-and-security/foundry-azure-credentials/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/claude-code/permissions-and-security/foundry-azure-credentials POST: https://latestn.com/dispute/tool/claude-code/permissions-and-security/foundry-azure-credentials with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/claude-code/permissions-and-security/foundry-azure-credentials?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I authenticate Claude Code with Microsoft Foundry using an API key, Microsoft Entra ID, or a bearer token? Revision 3, last verified 2026-11-20T12:22:11Z. https://latestn.com/tool/claude-code/permissions-and-security/foundry-azure-credentials (accessed 2026-11-21T09:58:45Z). @misc{LatestN_tool_claude_code_permissions_and_security_foundry_azure_credentials_r3, title = {How do I authenticate Claude Code with Microsoft Foundry using an API key, Microsoft Entra ID, or a bearer token?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/claude-code/permissions-and-security/foundry-azure-credentials}}, note = {Revision 3; digest sha256:4ebbcb67cca23cd4; last verified 2026-11-20T12:22:11Z; accessed 2026-11-21T09:58:45Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/claude-code/permissions-and-security/foundry-azure-credentials