If your company has already deployed Claude models on Microsoft Foundry, you can basically use Claude Code for free and save $17/month on a Claude subscription.
Check Your Access to Foundry
Microsoft Foundry (formerly Azure AI Studio) is a unified, enterprise-grade AI platform-as-a-service designed for developers to build, customize, and deploy AI applications and agents.
- Go to https://ai.azure.com/nextgen
- Click Build on the top navigation bar
- Click Models in the side menu
Make sure your organization already has Claude models deployed in Foundry (for example claude-opus-4-7).
Connect Foundry Models to Claude Code
I recommend using Entra ID + Azure CLI authentication. It's safer and more convenient than managing API keys manually.
Install Azure CLI before continuing:
After installing Azure CLI, sign in with:
az login
Set the following environment variables to enable Microsoft Foundry integration in Claude Code.
I usually put them in my .zshrc.
# Enable Microsoft Foundry integration
export CLAUDE_CODE_USE_FOUNDRY=1
# Azure resource name (replace {resource} with your resource name)
export ANTHROPIC_FOUNDRY_RESOURCE={resource}
# Or provide the full base URL:
# export ANTHROPIC_FOUNDRY_BASE_URL=https://{resource}.services.ai.azure.com/anthropic
In the current Foundry UI, resource are renamed to project.
Set the model variables to match your deployment names.
By default, the opus alias on Foundry may still resolve to Opus 4.6. To make sure Claude Code uses Opus 4.7, explicitly set:
export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-7'
export ANTHROPIC_DEFAULT_SONNET_MODEL='claude-sonnet-4-6'
export ANTHROPIC_DEFAULT_HAIKU_MODEL='claude-haiku-4-5'
Common Issues
Wrong Azure tenant
If your company uses multiple Azure tenants, az login may authenticate against the wrong one.
Check your current tenant with:
az account show
Switch tenants if needed:
az login --tenant <tenant-id>
Deployment name mismatch
The model name in Claude Code must match the deployment name configured in Foundry.
For example:
export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-7'
must exactly match the deployment name shown in the Foundry Models page.
Side Notes
Some companies provide Azure subscriptions or enterprise credits for internal development.
So even if your IT team has not deployed Claude models yet, you may still be able to deploy them yourself.
Just make sure you have permission before creating resources.
Top comments (2)
"Free at work" usually means your employer's cloud credits (Bedrock/Vertex) or an enterprise agreement is eating the bill - which is great for you personally, but worth flagging that "free to me" isn't "free." Someone's still paying per token, and at org scale the same waste (premium model on trivial tasks, bloated context) shows up as a line item finance eventually asks about.
So even on the company card, the routing/budget discipline still pays - it's just the org optimizing instead of you. The teams that treat "we have credits" as license to run everything through the biggest model are the ones that get a surprise cost-review six months in. Good practical tip for individuals, with the caveat that the cost doesn't vanish, it just moves up the org chart. Useful post.
I think nothing in this world is “free.” I wrote this post from my perspective—an employee’s perspective. Many big companies provide multiple ways for their employees to use AI tools. Some people don’t know that their Azure subscription can deploy Claude models and that those models can be used in Claude Code. It is a waste if they don't leverage is resources provide by their companies.
If my employer doesn’t want me to deploy models, they can revoke my access or set budget limits on my accounts. That’s the modern way to manage a company budget, rather than telling me, “The company is paying for your AI model usage, so be careful when using it to save costs.” Useful comment.