Skip to content

[awf] api-proxy: BYOK Azure OpenAI routing fails with 404 or 401 across base URL variants #4018

@lpcox

Description

@lpcox

Problem

When users configure BYOK with Azure OpenAI via COPILOT_PROVIDER_BASE_URL, the AWF api-proxy sidecar fails to route requests correctly, returning HTTP 404 or 401 regardless of base URL format tried.

Context

Upstream report: github/gh-aw#35483

Root Cause

The api-proxy Copilot adapter (containers/api-proxy/) likely does not handle Azure OpenAI's deployment-based URL structure (/openai/deployments/{deployment}/...) or the api-key header that Azure requires (instead of Authorization: Bearer). Azure OpenAI uses a distinct auth header and URL path format incompatible with the standard OpenAI adapter.

Proposed Solution

  1. In containers/api-proxy/, add an Azure OpenAI adapter that detects Azure endpoints (e.g., *.openai.azure.com) and rewrites requests to use api-key: <key> header instead of Authorization: Bearer.
  2. Accept COPILOT_PROVIDER_BASE_URL values in the canonical Azure format and normalize the deployment path.
  3. Add integration test with a mock Azure OpenAI endpoint to verify 200 responses across all supported URL variants.

Generated by Firewall Issue Dispatcher · sonnet46 1.2M ·

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions