Description
There has never been specific support for Azure Foundry OpenAI deployment in Azure GovCloud, however I used to be able to get it to work with this config:
{
"$schema": "https://opencode.ai/config.json",
"model": "azure/gpt-5.1",
"autoupdate": false,
"provider": {
"azure": {
"options": {
"apiKey": "<my api key>",
"baseURL": "https://<resource-name>.openai.azure.us/openai"
},
"models": {
"gpt-5.1": "gpt-5.1"
}
}
}
}
Recently, I started getting a "resource not found error". I think something has changed with the SDK or with Azure's API making opencode incompatible with Azure GovCloud OpenAI deployments. I tried adding the resourceName, apiVersion, and other arguments with no success. I have downgraded to a previous version without success as well.
At the core of the issue is the fact that the base url or endpoint for gov cloud is different (azure.us vs azure.com). If we could add specific support for govcloud where the resource name is only required, similar to how it works for the standard azure provider, that would be fantastic.
Plugins
No response
OpenCode version
1.18.2
Steps to reproduce
- Use this config in your opencode.jsonc
{
"$schema": "https://opencode.ai/config.json",
"model": "azure/gpt-5.1",
"autoupdate": false,
"provider": {
"azure": {
"options": {
"apiKey": "<my api key>",
"baseURL": "https://<resource-name>.openai.azure.us/openai"
},
"models": {
"gpt-5.1": "gpt-5.1"
}
}
}
}
- Run a test
opencode run "I am going to Paris, what should I see?" --model azure/gpt-5.1 --print-logs --log-level DEBUG --pure
- Depending on configuration changes, I will either get "Resource not Found" error, or problems connecting to the API at all
Screenshot and/or share link
No response
Operating System
mac OS 26.5.2
Terminal
No response
Description
There has never been specific support for Azure Foundry OpenAI deployment in Azure GovCloud, however I used to be able to get it to work with this config:
Recently, I started getting a "resource not found error". I think something has changed with the SDK or with Azure's API making opencode incompatible with Azure GovCloud OpenAI deployments. I tried adding the resourceName, apiVersion, and other arguments with no success. I have downgraded to a previous version without success as well.
At the core of the issue is the fact that the base url or endpoint for gov cloud is different (azure.us vs azure.com). If we could add specific support for govcloud where the resource name is only required, similar to how it works for the standard azure provider, that would be fantastic.
Plugins
No response
OpenCode version
1.18.2
Steps to reproduce
Screenshot and/or share link
No response
Operating System
mac OS 26.5.2
Terminal
No response