diff --git a/packages/types/src/provider-settings.ts b/packages/types/src/provider-settings.ts
index f4a19c532d..97edd2c807 100644
--- a/packages/types/src/provider-settings.ts
+++ b/packages/types/src/provider-settings.ts
@@ -416,7 +416,7 @@ const basetenSchema = apiModelIdProviderModelSchema.extend({
const azureSchema = apiModelIdProviderModelSchema.extend({
azureApiKey: z.string().optional(),
- azureResourceName: z.string().optional(),
+ azureBaseUrl: z.string().optional(),
azureDeploymentName: z.string().optional(),
azureApiVersion: z.string().optional(),
})
diff --git a/src/api/providers/__tests__/azure.spec.ts b/src/api/providers/__tests__/azure.spec.ts
index 0f794a6089..3d1171a8e2 100644
--- a/src/api/providers/__tests__/azure.spec.ts
+++ b/src/api/providers/__tests__/azure.spec.ts
@@ -36,7 +36,7 @@ describe("AzureHandler", () => {
beforeEach(() => {
mockOptions = {
azureApiKey: "test-api-key",
- azureResourceName: "test-resource",
+ azureBaseUrl: "https://test-resource.openai.azure.com/openai",
azureDeploymentName: "gpt-4o",
azureApiVersion: "2024-08-01-preview",
}
diff --git a/src/api/providers/azure.ts b/src/api/providers/azure.ts
index d8d0e513df..9da21cf4c5 100644
--- a/src/api/providers/azure.ts
+++ b/src/api/providers/azure.ts
@@ -35,12 +35,13 @@ export class AzureHandler extends BaseProvider implements SingleCompletionHandle
this.options = options
// Create the Azure provider using AI SDK
- // The @ai-sdk/azure package uses resourceName-based routing.
+ // baseURL supports both classic Azure OpenAI resources
+ // (.openai.azure.com) and newer AI Foundry resources
+ // (.cognitiveservices.azure.com).
// useDeploymentBasedUrls produces the universally compatible
- // /deployments/{id}/{path} URL shape that works on both classic
- // Azure OpenAI resources and newer AI Foundry resources.
+ // /deployments/{id}/{path} URL shape.
this.provider = createAzure({
- resourceName: options.azureResourceName ?? "",
+ baseURL: options.azureBaseUrl ?? "",
apiKey: options.azureApiKey, // Optional — Azure supports managed identity / Entra ID auth
apiVersion: options.azureApiVersion ?? azureOpenAiDefaultApiVersion,
useDeploymentBasedUrls: true,
diff --git a/src/shared/checkExistApiConfig.ts b/src/shared/checkExistApiConfig.ts
index 54e5bcc036..222c8648fe 100644
--- a/src/shared/checkExistApiConfig.ts
+++ b/src/shared/checkExistApiConfig.ts
@@ -11,9 +11,9 @@ export function checkExistKey(config: ProviderSettings | undefined) {
}
// Azure supports managed identity / Entra ID auth (no API key needed).
- // Consider it configured if resource name or deployment name is set.
+ // Consider it configured if base URL or deployment name is set.
if (config.apiProvider === "azure") {
- return !!(config.azureResourceName || config.azureDeploymentName || config.azureApiKey)
+ return !!(config.azureBaseUrl || config.azureDeploymentName || config.azureApiKey)
}
// Check all secret keys from the centralized SECRET_STATE_KEYS array.
diff --git a/webview-ui/src/components/settings/providers/Azure.tsx b/webview-ui/src/components/settings/providers/Azure.tsx
index ed0ca3f2e4..22918c0ac9 100644
--- a/webview-ui/src/components/settings/providers/Azure.tsx
+++ b/webview-ui/src/components/settings/providers/Azure.tsx
@@ -30,14 +30,14 @@ export const Azure = ({ apiConfiguration, setApiConfigurationField }: AzureProps
return (
<>