Skip to content

Azure OpenAI isn't supported by Agentic Workflows. #44809

Description

@jsalmassy

I've been trying to get Azure OpenAI to work for awhile now. I'm using copilot's cli to configure the agentic workflow and have had no success getting it to work. Either 1) Agentic Workflows doesn't support Azure OpenAI 2) There is a specific configuration in Azure OpenAI that isn't documented or 3) Copilot's agentic-workflow agent does not understand how to do this configuration.

Here is a summary of the output from the debug I ran on this last session representing 5 failed runs.

PR Coding Standards Review Workflow — BYOK Azure OpenAI Debugging Summary

Repo: redacted
Branch: redacted/701202-opanai
Workflow: .github/workflows/pr-coding-standards-review.md
Goal: Run the Copilot CLI engine through a BYOK Azure OpenAI deployment instead of GitHub's default model routing.


Azure Resource Facts

  • Resource: redacted
  • Endpoint: https://redacted.openai.azure.com/
  • Deployments: gpt-5.4 (original) and gpt-5.4-2026-03-05 (created during debugging)
  • Secret: AZURE_OPENAI_API_KEY (confirmed valid)

Run 1 — Authentication failure

  • Error: HTTP 401 from the API proxy
  • Root cause: COPILOT_PROVIDER_API_KEY was declared under secrets: in the frontmatter, which the compiler ignores for credential injection — the key never reached the proxy sidecar.
  • Fix: Moved all BYOK credentials into engine.env. Required upgrading the compiler from v0.81.6 → v0.82.0 (pre-release) since engine.env wasn't supported in the older version.

Run 2 — Model not found (first occurrence)

  • Error: Model 'gpt-5.4' not found on provider at http://172.30.0.30:10002/ (HTTP 404)
  • Authentication: Working ✅
  • Root cause: Unknown at the time. Hypothesis was the /openai/v1 path lacked broad model support.
  • Fix attempted: Changed COPILOT_PROVIDER_BASE_URL to .../openai/v1-preview.

Run 3 — v1-preview path doesn't exist

  • Error: Same "model not found" but with a clearer smoking gun: the models probe GET .../openai/v1-preview/models returned 404 — the entire /v1-preview path segment doesn't exist on this resource.
  • Fix: Reverted COPILOT_PROVIDER_BASE_URL back to .../openai/v1. Confirmed via curl that /openai/v1/models returns HTTP 200 with 164 models.

Curl diagnostic findings

Through direct curl tests against the Azure endpoint:

┌─────────────────────────────────────────────────────────────────────┬──────────────────────────────────────────┐
│ Test │ Result │
├─────────────────────────────────────────────────────────────────────┼──────────────────────────────────────────┤
│ GET /openai/v1/models │ ✅ 200 — returns 164 models │
├─────────────────────────────────────────────────────────────────────┼──────────────────────────────────────────┤
│ POST /openai/v1/chat/completions with model: gpt-5.4 │ ✅ Works — gpt-5.4 deployment responds │
├─────────────────────────────────────────────────────────────────────┼──────────────────────────────────────────┤
│ POST /openai/v1/chat/completions with model: gpt-5.4-2026-03-05 │ ✅ Works after new deployment created │
├─────────────────────────────────────────────────────────────────────┼──────────────────────────────────────────┤
│ POST /openai/v1/responses (Responses API) │ ✅ Endpoint exists and responds │
└─────────────────────────────────────────────────────────────────────┴──────────────────────────────────────────┘

Key finding: gpt-5.4 is a deployment name but is NOT in the /openai/v1/models list. The actual model ID in the list is gpt-5.4-2026-03-05. A second Azure deployment named gpt-5.4-2026-03-05 was created to match.


Runs 4 & 5 — Proxy routing failure (current blocker)

  • Error: Model 'gpt-5.4-2026-03-05' not found on provider at http://172.30.0.30:10002/ (HTTP 404)
  • Key observation: The awf-reflect process successfully fetches 164 models from the proxy (http://api-proxy:10002/openai/v1/models). The failure is not a models-list validation error — it happens when the Copilot CLI makes the actual inference call through the AWF API proxy sidecar (http://172.30.0.30:10002/).
  • Direct Azure calls work fine — the proxy itself is the blocker, not Azure.
  • Last fix attempted: Changed engine.model to openai/gpt-5.4-2026-03-05 (provider-prefixed) based on the theory that the AWF proxy's model routing rules require provider/model namespaced names (e.g. openai/gpt-5.4*, copilot/gpt-5.4*). This also did not resolve the issue.

Current state of engine: frontmatter

engine:
id: copilot
model: openai/gpt-5.4-2026-03-05
env:
COPILOT_PROVIDER_BASE_URL: https://redacted.openai.azure.com/openai/v1
COPILOT_PROVIDER_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
COPILOT_PROVIDER_WIRE_API: responses


Outstanding question for GitHub SA

The AWF API proxy sidecar (http://172.30.0.30:10002/) consistently returns HTTP 404 "model not found" for both gpt-5.4 and gpt-5.4-2026-03-05 when in BYOK mode pointing at Azure Foundry (/openai/v1). Direct calls to the Azure endpoint with the same model names succeed.

The core question: In BYOK mode with COPILOT_PROVIDER_BASE_URL pointing to Azure Foundry (/openai/v1), what exact format does COPILOT_MODEL / engine.model need to be in for the AWF API proxy to accept and correctly route the inference request to the provider?

Metadata

Metadata

Type

No type

Fields

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