Skip to content

[Fix] Azure OpenAI returns 404 with resource endpoint - #1192

Merged
edelauna merged 10 commits into
mainfrom
fix/azure-openai-404-0vf712oeb5860
Aug 9, 2026
Merged

[Fix] Azure OpenAI returns 404 with resource endpoint#1192
edelauna merged 10 commits into
mainfrom
fix/azure-openai-404-0vf712oeb5860

Conversation

@zoomote

@zoomote zoomote Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Created by Roomote. Follow up by mentioning @roomote, in the web UI, or in Discord.

What changed

  • Normalize Azure OpenAI resource endpoints to include the required /openai path before constructing the SDK client.
  • Preserve already-correct Azure endpoints and support explicit Azure mode behind custom hostnames.
  • Show an Azure-specific endpoint placeholder, deployment-name label, and model-name warning in OpenAI Compatible settings.
  • Translate the Azure endpoint and deployment guidance across all 17 supported non-English locales.
  • Add focused provider and component regression coverage, including a Playwright CT snapshot of the Azure settings state.

Why this change was made

Azure OpenAI requests returned 404 Resource not found when users entered the resource endpoint shown by Azure AI Studio because the SDK received a base URL without /openai. The generic model label also encouraged users to enter the underlying model name instead of their user-defined Azure deployment name.

Impact

Users can connect with either the Azure resource endpoint or the full /openai endpoint, and the settings UI now makes the deployment-name requirement explicit in every supported language. Generic OpenAI-compatible providers and Azure AI Inference retain their existing request paths.

Related PRs

Closes #1191

@codecov

codecov Bot commented Aug 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@edelauna
edelauna marked this pull request as ready for review August 8, 2026 19:21
@github-actions github-actions Bot added the awaiting-review PR changes are ready and waiting for maintainer re-review label Aug 8, 2026
@github-actions github-actions Bot added awaiting-review PR changes are ready and waiting for maintainer re-review and removed awaiting-review PR changes are ready and waiting for maintainer re-review labels Aug 9, 2026

@navedmerchant navedmerchant left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review summary

The core Azure OpenAI /openai normalization is sound for the documented resource-root and already-normalized endpoint forms, and the provider/UI/translation coverage is strong. I am requesting changes for one confirmed UI/runtime routing mismatch.

Medium — Azure AI Inference can receive contradictory Azure OpenAI guidance

Location: isAzureOpenAiBaseUrl(), OpenAICompatible(), and OpenAiHandler.constructor().

The helper returns true immediately when openAiUseAzure is enabled, before checking whether the host ends in services.ai.azure.com. The UI relies directly on that result. The backend, however, computes Azure AI Inference independently and gives it precedence at OpenAiHandler.constructor(), so the same profile is routed through the plain OpenAI/Azure AI Inference path. This also contradicts the helper documentation stating that Azure AI Inference endpoints return false at isAzureOpenAiBaseUrl().

A profile containing both openAiBaseUrl: https://my-resource.services.ai.azure.com/models and openAiUseAzure: true therefore displays the Azure OpenAI /openai placeholder and asks for an Azure deployment name, while runtime requests retain Azure AI Inference semantics and expect the model identifier. Users can be guided into entering the wrong identifier and receive request failures.

Recommendation: Make route precedence shared and unambiguous. At minimum, classify services.ai.azure.com as Azure AI Inference before honoring the explicit Azure OpenAI flag. Preferably expose a shared three-way classifier for Azure OpenAI, Azure AI Inference, and generic OpenAI, then use it in both backend and UI. Add a regression test for the combined Azure AI Inference URL plus enabled Azure flag.

Verification

  • Focused backend suite: 69/69 passed.
  • Focused webview suite: 15/15 passed.
  • Types package, extension, and webview type checks passed.
  • ESLint passed on all changed TypeScript/TSX files.
  • Translation completeness and locale JSON validation passed.
  • Real OpenAI 5.23.2 request construction produced the expected Azure deployment URL for all four normalized forms.
  • Local Playwright component bundling succeeded, but browser execution was unavailable because Chromium is not installed. The PR's CI webview-visual job passed, along with all other reported checks.

Verdict: Request changes.

@github-actions github-actions Bot added awaiting-author PR is waiting for the author to address requested changes and removed awaiting-review PR changes are ready and waiting for maintainer re-review labels Aug 9, 2026

@navedmerchant navedmerchant left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Azure AI Inference precedence issue is actionable on the changed helper line below. Please make the classifier shared/unambiguous so the UI does not show Azure OpenAI deployment guidance when the runtime will use the Azure AI Inference route.

Comment thread packages/types/src/providers/openai.ts
@github-actions github-actions Bot removed the awaiting-author PR is waiting for the author to address requested changes label Aug 9, 2026
@edelauna
edelauna added this pull request to the merge queue Aug 9, 2026
Merged via the queue into main with commit c38b579 Aug 9, 2026
16 checks passed
@edelauna
edelauna deleted the fix/azure-openai-404-0vf712oeb5860 branch August 9, 2026 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Azure OpenAI 404 — missing /openai path and no deployment-name hint

3 participants