Skip to content

Azure OpenAI Configuration Help #6381

@landoncrabtree

Description

@landoncrabtree

Question

Hi all,

Found this issue #4136 and seems related, but the OP said the issue was fixed without details :(

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "azure": {
      "options": {
        "apiKey": "",
        "baseURL": "https://EXAMPLE.openai.azure.com/",
        "resourceName": "EXAMPLE",
      },
      "models": {
        "gpt-4.1": {
          "name": "gpt-4.1",
        },
      },
    },
  },
  "agent": {
    "codeql-validator": {
      "mode": "primary",
      "model": "azure/gpt-4.1",
      "prompt": "{file:./prompts/CODEQL_VALIDATOR.md}",
      "tools": {
        "write": true,
        "edit": true,
        "bash": true,
        "webfetch": false
      },
      "permission": {
        "edit": "allow",
        "bash": "allow",
        "webfetch": "deny"
      }
    }
  }
}

I have this configuration (with the API key, base URL, and resource name properly filled out). Additionally, I have an Azure OpenAI deployment called gpt-4.1 (case sensitive) created. However, when running opencode, I get the error: Resource not found.

Is there something wrong with the way I have the provider created?

Metadata

Metadata

Assignees

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