From d54e1c1f2dae98618ea0f9def0356ec764a46eee Mon Sep 17 00:00:00 2001
From: Timothy Carambat <rambat1010@gmail.com>
Date: Wed, 10 Apr 2024 09:34:14 -0700
Subject: [PATCH] expand support for non-US azure deployments (#1080)

* expand support for non-US azure deployments

* update conditional
---
 server/utils/helpers/updateENV.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/server/utils/helpers/updateENV.js b/server/utils/helpers/updateENV.js
index a026fe338..b23855877 100644
--- a/server/utils/helpers/updateENV.js
+++ b/server/utils/helpers/updateENV.js
@@ -425,8 +425,8 @@ function validChromaURL(input = "") {
 function validAzureURL(input = "") {
   try {
     new URL(input);
-    if (!input.includes("openai.azure.com"))
-      return "URL must include openai.azure.com";
+    if (!input.includes("openai.azure.com") && !input.includes("microsoft.com"))
+      return "Valid Azure endpoints must contain openai.azure.com OR microsoft.com";
     return null;
   } catch {
     return "Not a valid URL";
-- 
GitLab