Skip to content

feat: add Azure OpenAI provider support#525

Draft
Bl3f wants to merge 3 commits intomainfrom
cursor/azure-ai-provider-support-60a1
Draft

feat: add Azure OpenAI provider support#525
Bl3f wants to merge 3 commits intomainfrom
cursor/azure-ai-provider-support-60a1

Conversation

@Bl3f
Copy link
Copy Markdown
Contributor

@Bl3f Bl3f commented Mar 26, 2026

Summary

Adds Azure OpenAI as a supported LLM provider using the @ai-sdk/azure package.

Changes

Backend (apps/backend/)

  • Added 'azure' to llmProviderSchema enum in types/llm.ts
  • Added AzureOpenAIResponsesProviderOptions to ProviderConfigMap
  • Added Azure entry to PROVIDER_META in provider-meta.ts with:
    • API key authentication (required)
    • Extra fields: Resource Name (alternative to base URL), API Version, Use Deployment-Based URLs
    • Hint clarifying that either Resource Name or Base URL should be provided, not both
    • AZURE_API_KEY env var, AZURE_OPENAI_BASE_URL base URL env var
    • Empty models list — Azure deployments are user-specific and depend on the base URL / resource, so no default models are hardcoded
    • Empty extractorModelId / summaryModelId (users must configure their own deployment names)
  • Added Azure factory in LLM_PROVIDERS in providers.ts using createAzure from @ai-sdk/azure
    • Base URL takes precedence over resource name when both are provided
    • apiVersion and useDeploymentBasedUrls are forwarded to createAzure when set
    • All extra fields fall back to their respective env vars
    • Uses Responses API by default (consistent with the @ai-sdk/azure SDK default)
  • Guarded getDefaultModelId against empty models arrays to prevent crashes

Frontend (apps/frontend/)

  • Added Azure SVG icon
  • Added 'azure' case to LlmProviderIcon component
  • Added 'Azure OpenAI' label to providerLabels in usage filters

Config

  • Added Azure env vars to .env.example
  • Installed @ai-sdk/azure dependency

Environment Variables

Variable Description
AZURE_API_KEY Azure OpenAI API key
AZURE_RESOURCE_NAME Azure resource name (builds https://{name}.openai.azure.com) — alternative to base URL
AZURE_OPENAI_BASE_URL Full base URL override — alternative to resource name
AZURE_API_VERSION API version (defaults to v1)
AZURE_USE_DEPLOYMENT_BASED_URLS Set to true for legacy deployment URL format

Testing

  • npm run lint -w @nao/backend — passes
  • npm run lint -w @nao/frontend — passes
Open in Web Open in Cursor 

- Add 'azure' to llmProviderSchema enum and ProviderConfigMap type
- Add Azure entry to PROVIDER_META with API key + resource name auth
- No default models (deployment-specific, depends on user's base URL)
- Add Azure factory in LLM_PROVIDERS using @ai-sdk/azure createAzure
- Add Azure icon SVG and provider icon case
- Add 'Azure OpenAI' label to usage filters
- Add Azure env vars to .env.example
- Guard getDefaultModelId against empty models array

Co-authored-by: Christophe Blefari <christophe.blefari@gmail.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 26, 2026

🚀 Preview Deployment

URL https://pr-525-419ed77.preview.getnao.io
Commit 419ed77

⚠️ No LLM API keys configured - you'll see the API key setup flow when trying to chat.


Preview will be automatically removed when this PR is closed.

cursoragent and others added 2 commits March 26, 2026 17:06
The resource name is embedded in the base URL the user provides, and the
deployment name is the model ID entered in the UI. No need for a separate
credential field.

Co-authored-by: Christophe Blefari <christophe.blefari@gmail.com>
…rovider

Restore resourceName as an extra field (alternative to baseURL — not both).
Add apiVersion and useDeploymentBasedUrls extra fields matching the
@ai-sdk/azure createAzure options. All three fall back to env vars.

Co-authored-by: Christophe Blefari <christophe.blefari@gmail.com>
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.

2 participants