Skip to content

Setting up opencode with azure ai foundry (openai) project issue #4136

Description

@BenjaminOmar

Question

i am trying to set up opencode to use a deployment from my azure ai foundry (openai) project. i have therefore set up this opencode.jsonc file:

{
  "$schema": "https://opencode.ai/config.json",
  "model": "azure/GPT-4.1",
  "theme": "opencode",
  "autoupdate": true,
  "provider": {
    "azure": {
      "options": {
        "apiKey": "api-key",
        "baseURL": "url-to-ai-foundry-project",
        "resourceName": "opencode-test"
      },
      "models": {
        "azure/GPT-4.1": {
          "name": "GPT-4.1"
        }
      }
    }
  }
}

I have then used the powershell command [System.Environment]::SetEnvironmentVariable('AZURE_RESOURCE_NAME', 'opencode-test', 'User') to set the resuce name.

Lastly i used the opencode auth login and pasted the same api key that is set within the opencode.jsonc.

When i then try to use opencode, i then get:

Image

anyone know what i might be doing wrong? is there a way to run it in "verbose mode", so it is easier to debug?

This is the model info:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions