Claude Code on Microsoft Foundry changedmicrosoft-foundry
Nearest release: v2.1.294, published an hour after upstream edited the page. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
Upstream edited this page at 8 Oct 2026 02:40 UTC, give or take a minute or two: the time comes from Anthropic’s own sitemap rather than from a commit. This site recorded the change at 8 Oct 2026 03:07 UTC.
Upstream edited
Recorded here
Lines+43added
Lines−35removed
From line
104
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits6to this page, all time
#### Use an API key #### Use Microsoft Entra ID #### Use a bearer token
The whole hunk
from line 104, old and new numbered
/
from line 104
104104
105105### 2. Configure Azure credentials
106106
107Claude Code supports three authentication methods for Microsoft Foundry. Choose the method that best fits your security requirements.
107Claude Code supports three authentication methods for Microsoft Foundry. Choose the method that best fits your security requirements:
108108
109**Option A: API key authentication**
109* [API key](#use-an-api-key): you copy a key from the Microsoft Foundry portal and set it as `ANTHROPIC_FOUNDRY_API_KEY`
110* [Microsoft Entra ID](#use-microsoft-entra-id): Claude Code gets tokens through the Azure SDK default credential chain, for example from an `az login` session, so there's no API key to store
111* [Bearer token](#use-a-bearer-token): another process obtains a Microsoft Entra ID access token and you pass it in `ANTHROPIC_FOUNDRY_AUTH_TOKEN`
110112
1111. Navigate to your resource in the Microsoft Foundry portal
1122. Go to the **Endpoints and keys** section
113<Note>
114 When using Microsoft Foundry, the `/logout` command is unavailable since authentication is handled through Azure credentials.
115</Note>
116
117#### Use an API key
118
119Copy a key from the Microsoft Foundry portal, then set it as an environment variable:
120
1211. Go to your resource in the Microsoft Foundry portal
1222. Open the **Endpoints and keys** section
1131233. Copy **API Key**
1141244. Set the environment variable, replacing `your-azure-api-key` with the key you copied:
115125
from line 127
117127export ANTHROPIC_FOUNDRY_API_KEY=your-azure-api-key
118128```
119129
120**Option B: Microsoft Entra ID authentication**
130#### Use Microsoft Entra ID
121131
122When neither `ANTHROPIC_FOUNDRY_API_KEY` nor `ANTHROPIC_FOUNDRY_AUTH_TOKEN` is set, Claude Code automatically uses the Azure SDK [default credential chain](https://learn.microsoft.com/en-us/azure/developer/javascript/sdk/authentication/credential-chains#defaultazurecredential-overview).
132Leave `ANTHROPIC_FOUNDRY_API_KEY` and `ANTHROPIC_FOUNDRY_AUTH_TOKEN` unset. Claude Code then uses the Azure SDK [default credential chain](https://learn.microsoft.com/en-us/azure/developer/javascript/sdk/authentication/credential-chains#defaultazurecredential-overview).
123133This supports a variety of methods for authenticating local and remote workloads.
124134
125On local environments, you commonly may use the Azure CLI:
135On a local machine, sign in with the Azure CLI:
126136
127137```bash theme={null}
128138az login
129139```
130140
131**Option C: Bearer token authentication**
141For the roles your identity needs, see [Azure RBAC configuration](#azure-rbac-configuration).
132142
143#### Use a bearer token
144
133145Claude Code sends the value of `ANTHROPIC_FOUNDRY_AUTH_TOKEN` on every request as the `Authorization: Bearer` header. Use this option when another process, such as a host application or a sign-in script, has already obtained an access token for you. Requires Claude Code v2.1.203 or later.
134146
135147Set the variable to a bearer token that Microsoft Entra ID issued for your resource:
from line 151
139151```
140152
141153`ANTHROPIC_FOUNDRY_AUTH_TOKEN` takes precedence over `ANTHROPIC_FOUNDRY_API_KEY` and over the default credential chain.
142
143<Note>
144 When using Microsoft Foundry, the `/logout` command is unavailable since authentication is handled through Azure credentials.
145</Note>
146154
147155### 3. Configure Claude Code
148156
No line in this hunk matches that.