⌨️ANTHROPIC_FOUNDRY_API_KEY
Also known as ANTHROPIC_FOUNDRY_AUTH_TOKEN
It gives Claude Code a key to sign in to Microsoft Foundry.
Think of it like
It is like the key to your shop, or a pass from the head office.
Example
Jack's CI cannot use his own Azure sign-in. He stores a Foundry key as a secret and sets it here, and the job signs in by itself.
Why it matters
Scripts and CI need a sign-in that does not depend on a person being logged in.
Definition
Example code
bash
export CLAUDE_CODE_USE_FOUNDRY=1
export ANTHROPIC_FOUNDRY_RESOURCE=my-resource
export ANTHROPIC_FOUNDRY_API_KEY=your-foundry-key
claudeCommon mistake
Key takeaways
- 1Key. A Foundry API key.
- 2Token wins. Entra bearer token.
- 3Neither. Azure sign-in.