[PR #24880] [CLOSED] fix: set azure: true for Azure provider on non-azure.* hostnamesFix/azure provider missing azure flag #131568

Closed
opened 2026-05-21 17:14:16 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/24880
Author: @sergey-zinchenko
Created: 5/18/2026
Status: Closed

Base: devHead: fix/azure-provider-missing-azure-flag


📝 Commits (10+)

📊 Changes

2 files changed (+14 additions, -7 deletions)

View changed files

📝 backend/open_webui/routers/openai.py (+10 -5)
📝 src/lib/components/AddConnectionModal.svelte (+4 -2)

📄 Description

Pull Request Checklist

Before submitting, make sure you've checked the following:

  • Linked Issue/Discussion: Closes #24872. Addresses #17121.
  • Target branch: dev
  • Description: See below.
  • Changelog: See Changelog Entry below.
  • Documentation: Not required — no new user-facing settings; existing Azure OpenAI flow is fixed.
  • Dependencies: None.
  • Testing: Manual — Azure OpenAI provider on custom hostname; Verify succeeds; chat returns a reply. Tested against Azure-compatible gateway (DIAL-style deployment API).
  • Agentic AI Code: Human-reviewed and manually tested.
  • Code review: Self-reviewed.
  • Design & Architecture: Minimal change; no new settings.
  • Git Hygiene: Single logical fix (UI config + backend routing).
  • Title Prefix: fix:

Changelog Entry

Description

  • Fix Azure OpenAI connections on custom base URLs (hostnames without azure. / cognitive.microsoft.com). Selecting Azure OpenAI in the connection modal now persists azure: true, and the backend treats provider: "azure" as Azure mode so verify and chat use deployment API paths (/openai/models, /openai/deployments/{model}/chat/completions).

Added

  • is_azure_openai_config() helper in routers/openai.py for consistent Azure routing checks.

Changed

  • AddConnectionModal.svelte: save azure: true whenever Azure mode is active (including when Provider is Azure OpenAI), not only on URL auto-detection.
  • routers/openai.py: use is_azure_openai_config() instead of api_config.get('azure', False) for verify, models, and chat completion routing.

Deprecated

  • N/A

Removed

  • N/A

Fixed

  • Azure OpenAI provider failing on custom gateway URLs: Verify showed “Network error” and chat returned no reply because only provider: "azure" was saved without azure: true, so requests hit /models and /chat/completions instead of Azure deployment endpoints (#24872).

Security

  • N/A

Breaking Changes

  • N/A

Additional Information

Problem

The Azure OpenAI provider in Admin Panel → Settings → Connections is intended for gateways that use the Azure deployment API (APIM, private endpoints) where the hostname does not trigger auto-detection (azure. / cognitive.microsoft.com).

On save/verify, the UI used:

...(provider ? { provider } : azure ? { azure: true } : {})

Choosing Azure OpenAI stored provider: "azure" but omitted azure: true. The backend only checked api_config.get('azure', False), so verify and chat used generic OpenAI paths and failed on Azure-compatible gateways.

Solution

  1. Frontend: Always persist azure: true when Azure mode is active; keep provider: "azure" when selected.
  2. Backend: is_azure_openai_config() returns true for azure: true or provider === 'azure' (backward compatibility for existing saved configs).

Related

  • Closes #24872
  • Addresses #17121 (custom Azure URLs via explicit provider)

Files changed

  • src/lib/components/AddConnectionModal.svelte
  • backend/open_webui/routers/openai.py

Screenshots or Videos

image
  • Before: Verify → “Network error” on custom host with Azure OpenAI provider
  • After: Verify → success; chat receives assistant reply

Contributor License Agreement



🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/24880 **Author:** [@sergey-zinchenko](https://github.com/sergey-zinchenko) **Created:** 5/18/2026 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `fix/azure-provider-missing-azure-flag` --- ### 📝 Commits (10+) - [`fe6783c`](https://github.com/open-webui/open-webui/commit/fe6783c16699911c7be17392596d579333fb110c) Merge pull request #19030 from open-webui/dev - [`fc05e0a`](https://github.com/open-webui/open-webui/commit/fc05e0a6c5d39da60b603b4d520f800d6e36f748) Merge pull request #19405 from open-webui/dev - [`e3faec6`](https://github.com/open-webui/open-webui/commit/e3faec62c58e3a83d89aa3df539feacefa125e0c) Merge pull request #19416 from open-webui/dev - [`9899293`](https://github.com/open-webui/open-webui/commit/9899293f050ad50ae12024cbebee7e018acd851e) Merge pull request #19448 from open-webui/dev - [`140605e`](https://github.com/open-webui/open-webui/commit/140605e660b8186a7d5c79fb3be6ffb147a2f498) Merge pull request #19462 from open-webui/dev - [`6f1486f`](https://github.com/open-webui/open-webui/commit/6f1486ffd0cb288d0e21f41845361924e0d742b3) Merge pull request #19466 from open-webui/dev - [`d95f533`](https://github.com/open-webui/open-webui/commit/d95f533214e3fe5beb5e41ec1f349940bc4c7043) Merge pull request #19729 from open-webui/dev - [`a727153`](https://github.com/open-webui/open-webui/commit/a7271532f8a38da46785afcaa7e65f9a45e7d753) 0.6.43 (#20093) - [`6adde20`](https://github.com/open-webui/open-webui/commit/6adde203cd292a9e3af9c64a2ae36b603fed096a) Merge pull request #20394 from open-webui/dev - [`f9b0534`](https://github.com/open-webui/open-webui/commit/f9b0534e0c442631d1cb7205169588b9b6204179) Merge pull request #20522 from open-webui/dev ### 📊 Changes **2 files changed** (+14 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/routers/openai.py` (+10 -5) 📝 `src/lib/components/AddConnectionModal.svelte` (+4 -2) </details> ### 📄 Description # Pull Request Checklist **Before submitting, make sure you've checked the following:** - [x] **Linked Issue/Discussion:** Closes #24872. Addresses #17121. - [x] **Target branch:** `dev` - [x] **Description:** See below. - [x] **Changelog:** See Changelog Entry below. - [ ] **Documentation:** Not required — no new user-facing settings; existing Azure OpenAI flow is fixed. - [x] **Dependencies:** None. - [x] **Testing:** Manual — Azure OpenAI provider on custom hostname; Verify succeeds; chat returns a reply. Tested against Azure-compatible gateway (DIAL-style deployment API). - [x] **Agentic AI Code:** Human-reviewed and manually tested. - [x] **Code review:** Self-reviewed. - [x] **Design & Architecture:** Minimal change; no new settings. - [x] **Git Hygiene:** Single logical fix (UI config + backend routing). - [x] **Title Prefix:** `fix:` --- # Changelog Entry ### Description - Fix Azure OpenAI connections on custom base URLs (hostnames without `azure.` / `cognitive.microsoft.com`). Selecting **Azure OpenAI** in the connection modal now persists `azure: true`, and the backend treats `provider: "azure"` as Azure mode so verify and chat use deployment API paths (`/openai/models`, `/openai/deployments/{model}/chat/completions`). ### Added - `is_azure_openai_config()` helper in `routers/openai.py` for consistent Azure routing checks. ### Changed - `AddConnectionModal.svelte`: save `azure: true` whenever Azure mode is active (including when **Provider** is **Azure OpenAI**), not only on URL auto-detection. - `routers/openai.py`: use `is_azure_openai_config()` instead of `api_config.get('azure', False)` for verify, models, and chat completion routing. ### Deprecated - N/A ### Removed - N/A ### Fixed - Azure OpenAI provider failing on custom gateway URLs: **Verify** showed “Network error” and chat returned no reply because only `provider: "azure"` was saved without `azure: true`, so requests hit `/models` and `/chat/completions` instead of Azure deployment endpoints ([#24872](https://github.com/open-webui/open-webui/issues/24872)). ### Security - N/A ### Breaking Changes - N/A --- ### Additional Information **Problem** The **Azure OpenAI** provider in Admin Panel → Settings → Connections is intended for gateways that use the Azure deployment API (APIM, private endpoints) where the hostname does not trigger auto-detection (`azure.` / `cognitive.microsoft.com`). On save/verify, the UI used: ```js ...(provider ? { provider } : azure ? { azure: true } : {}) ``` Choosing **Azure OpenAI** stored `provider: "azure"` but omitted `azure: true`. The backend only checked `api_config.get('azure', False)`, so verify and chat used generic OpenAI paths and failed on Azure-compatible gateways. **Solution** 1. **Frontend:** Always persist `azure: true` when Azure mode is active; keep `provider: "azure"` when selected. 2. **Backend:** `is_azure_openai_config()` returns true for `azure: true` or `provider === 'azure'` (backward compatibility for existing saved configs). **Related** - Closes [#24872](https://github.com/open-webui/open-webui/issues/24872) - Addresses [#17121](https://github.com/open-webui/open-webui/issues/17121) (custom Azure URLs via explicit provider) **Files changed** - `src/lib/components/AddConnectionModal.svelte` - `backend/open_webui/routers/openai.py` ### Screenshots or Videos <img width="3115" height="1422" alt="image" src="https://github.com/user-attachments/assets/6de31377-54fb-4fb9-be58-365b09ab886b" /> - [ ] Before: Verify → “Network error” on custom host with **Azure OpenAI** provider - [X] After: Verify → success; chat receives assistant reply ### Contributor License Agreement - [x] By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms. --- --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-21 17:14:16 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#131568