Skip to content

Bug: Unable to connect Azure AI Foundry Serverless Models (DeepSeek) due to strict Provider/Model validation #12102

Closed

Description

@JohanensKarlin

CLI cannot connect to Azure AI Foundry Serverless endpoints or OpenAI-compatible APIs

Describe the bug

The CLI (v1.1.51) currently cannot connect to Azure AI Foundry Serverless endpoints or other OpenAI-compatible APIs (like vLLM) because of two restrictive design choices:

  1. Azure Provider: Forces a resourceName and builds a legacy URL path (/openai/deployments/...), which results in Resource not found for Serverless endpoints.
  2. OpenAI Provider: Validates the model name against a hardcoded internal list, rejecting any non-standard model names (like DeepSeek-V3.2) even when a custom baseURL is defined.

Steps to Reproduce

Setup: Azure AI Foundry Serverless Deployment (DeepSeek-V3.2)
Endpoint: https://<id>.services.ai.azure.com/openai/v1

Attempt 1: Using azure provider

{
  "model": "azure/deepseek-v3.2",
  "provider": {
    "azure": {
      "options": {
        "apiKey": "REDACTED",
        "baseURL": "https://<id>.services.ai.azure.com/openai/v1"
      }
    }
  }
}

Error: AI_LoadSettingError: Azure OpenAI resource name setting is missing.

Conflict: Serverless endpoints do not follow the {resourceName}.openai.azure.com pattern. Adding a dummy resourceName causes the CLI to construct an invalid URL.

Attempt 2: Using openai provider (as a proxy)

{
  "model": "openai/DeepSeek-V3.2",
  "provider": {
    "openai": {
      "options": {
        "apiKey": "REDACTED",
        "baseURL": "https://<id>.services.ai.azure.com/openai/v1"
      }
    }
  }
}

Error: ProviderModelNotFoundError (model name is not in the hardcoded list for OpenAI).

Expected Behavior

  • BaseURL Priority: If a baseURL is provided, the CLI should respect it as a full path and stop appending provider-specific path segments (like /deployments/).
  • Flexible Validation: Disable model name validation when a custom baseURL is present to support the growing ecosystem of OpenAI-compatible providers (Foundry, vLLM, Ollama).
  • Optional resourceName: Make resourceName optional for the Azure provider when using Foundry Serverless URLs.

Environment

  • OS: Windows 11
  • OpenCode Version: 1.1.51
  • Model: DeepSeek-V3.2 via Azure AI Foundry Serverless

Additional Context

Azure AI Foundry Serverless endpoints use a different URL structure than traditional Azure OpenAI deployments. The current implementation assumes all Azure endpoints follow the legacy pattern, which breaks compatibility with newer Azure AI services.

Activity

  1. github-actions commented on Feb 4, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Feel free to ignore if none of these address your specific case.

  2. hexa00 commented on Feb 20, 2026

    @hexa00

    I tried this recently with:

    opencode --version
    1.2.10

        "azure-foundry": {
          "options": {
            "baseURL": "https://FOO.services.ai.azure.com/models",
            "apiKey": "BAR"
          },
          "models": {
            "kimi-k2.5": {
              "name": "Kimi K2.5 (Azure Foundry)"
            }
          }
        },
    

    And this worked

  3. github-actions commented on Apr 22, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions