You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Not clear info on how to properly setup Azure and Azure Cognitive Services Provider #14494
An Issue from Discord where a user could not properly get the Azure provider to work after trying to add it in using the opencode auth login command, due to missing AZURE_RESOURCE_NAME environment variable.
If your issue is already addressed in one of these, please consider closing this one. Otherwise, feel free to keep it open with any additional details that differentiate your case.
For posterity here's the nonFoundry Models (aka /openai/v1 standards) equivalent for anyone interested in future. Not quite sure why one needs resourceName and the other freaks out when resourceName param is used (shrug) > above my intelligence level.
@OpeOginni your context/output limitation setting for Kimi k2.5 in another issue helped so thank you!
What about for those models that don't have OpenAI endpoints routes like Anthrophic's? They seem to not to work for whatever reason:
As for models that have an OpenAI endpoint such as Kimi-K2.5, configuring it as an /openai/v1 model works... until it doesn't and starts exposing the Tool Calls for some reason:
I personally think that Azure is really not well integrated with OpenCode and must be worked on, or that the documentation is poor at best. My company uses Azure so it's the only thing we have available, and Claude Code (thru Azure Foundry) is costing us hundreds; even Claude has proper documentation on configuring Azure Foundry.
What about for those models that don't have OpenAI endpoints routes like Anthrophic's? They seem to not to work for whatever reason:
@ktzug I just ended up setting two different custom providers: one for OpenAI-style endpoints and another one for Anthropic's. You can use the @ai-sdk/anthropic package:
The Azure system is not the cleanest, and is a bit confusing, but I have a PR to improve this flow, and maybe add a special provider for Azure Anthropic, then the Cognitive Service could be for other OpenAI Compatible models
@tmeckel this seems good, but I was thinking a better solution would be to make providers for each azure openai, azure anthrpoic and azure openai compatible, but lets see what the team thinks of
@bakaburg1 what issue do you have, ik of folks making use of Azure models perfectly on OpenCode. Maybe let me know the issue and what models exactly you are trying to make use of.
Activity
github-actions commentedon Feb 20, 2026
This issue might be a duplicate of existing issues. Please check:
AZURE_RESOURCE_NAMEerror when using the Azure Cognitive Services provider afteropencode auth loginIf your issue is already addressed in one of these, please consider closing this one. Otherwise, feel free to keep it open with any additional details that differentiate your case.
absolutegravitas commentedon Feb 21, 2026
here's my setup if that helps for Azure Foundry / Azure Cognitive Services:
confirmed working in opencode

OpeOginni commentedon Feb 21, 2026
Thanks, used that and other tests to improve the docs on cases where the used model is not an openai one
absolutegravitas commentedon Feb 22, 2026
For posterity here's the nonFoundry Models (aka /openai/v1 standards) equivalent for anyone interested in future. Not quite sure why one needs resourceName and the other freaks out when resourceName param is used (shrug) > above my intelligence level.
@OpeOginni your context/output limitation setting for Kimi k2.5 in another issue helped so thank you!
ktzug commentedon Feb 25, 2026
What about for those models that don't have OpenAI endpoints routes like Anthrophic's? They seem to not to work for whatever reason:
As for models that have an OpenAI endpoint such as Kimi-K2.5, configuring it as an /openai/v1 model works... until it doesn't and starts exposing the Tool Calls for some reason:
I personally think that Azure is really not well integrated with OpenCode and must be worked on, or that the documentation is poor at best. My company uses Azure so it's the only thing we have available, and Claude Code (thru Azure Foundry) is costing us hundreds; even Claude has proper documentation on configuring Azure Foundry.
rifusaki commentedon Feb 25, 2026
@ktzug I just ended up setting two different custom providers: one for OpenAI-style endpoints and another one for Anthropic's. You can use the
@ai-sdk/anthropicpackage:However I gotta agree documentation is severely lacking.
OpeOginni commentedon Feb 25, 2026
The Azure system is not the cleanest, and is a bit confusing, but I have a PR to improve this flow, and maybe add a special provider for Azure Anthropic, then the Cognitive Service could be for other OpenAI Compatible models
tmeckel commentedon Mar 6, 2026
Because the support for Azure was always not the best in OpenCode I created a new provider for OpenCode and other products using ai-sdk approach.
https://github.com/ophiosdev/azure-foundry-provider
Highlights
/openai/v1base root with mode-driven routingsystem,max_tokensis used)auto,off,on)maxConcurrentadmission (wake-on-release, abort-aware waits)rpm,tpm,maxConcurrent,maxOutputTokensCap)x-ratelimit-*headersreasoning_content/reasoningfields)onRetry,onAdaptiveCooldown,onSanitizedRetry,onFallback)AbortSignalCC @OpeOginni @rekram1-node
OpeOginni commentedon Mar 6, 2026
@tmeckel this seems good, but I was thinking a better solution would be to make providers for each
azure openai,azure anthrpoicandazure openai compatible, but lets see what the team thinks ofbakaburg1 commentedon May 28, 2026
I'd really like to introduce OpenCode in my agency, but the Azure integration must be done right, otherwise it's a too big of a barrier for users.
OpeOginni commentedon May 28, 2026
@bakaburg1 what issue do you have, ik of folks making use of Azure models perfectly on OpenCode. Maybe let me know the issue and what models exactly you are trying to make use of.
Here to help!
github-actions commentedon Jul 28, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.