Skip to content

Add direct host/base_url support for Azure OpenAI#303

Open
TonsOfFun wants to merge 1 commit intomainfrom
feature/azure-openai-support
Open

Add direct host/base_url support for Azure OpenAI#303
TonsOfFun wants to merge 1 commit intomainfrom
feature/azure-openai-support

Conversation

@TonsOfFun
Copy link
Contributor

Summary

  • Adds support for configuring Azure OpenAI with a direct host or base_url parameter
  • Makes azure_resource and deployment_id optional when host is provided
  • Supports Azure AI Foundry endpoints (cognitiveservices.azure.com), custom domains, and any Azure OpenAI-compatible endpoint

Motivation

The current Azure configuration requires azure_resource and deployment_id which constructs the URL as:

https://{azure_resource}.openai.azure.com/openai/deployments/{deployment_id}

However, many Azure deployments use different URL patterns:

  • Azure AI Foundry: https://{resource}.cognitiveservices.azure.com/openai/deployments/{model}
  • Custom domains
  • Regional endpoints

This change allows direct URL configuration:

azure:
  service: "AzureOpenAI"
  api_key: <%= ENV["AZURE_OPENAI_API_KEY"] %>
  host: "https://mycompany.cognitiveservices.azure.com/openai/deployments/gpt-4"
  api_version: "2024-10-21"

Test plan

  • New tests added for direct host configuration
  • Existing tests continue to pass
  • Manual testing with Azure AI Foundry endpoint

🤖 Generated with Claude Code

Allow configuring Azure OpenAI with a direct host URL instead of
requiring azure_resource + deployment_id. This supports:

- Azure AI Foundry endpoints (cognitiveservices.azure.com)
- Custom domain configurations
- Any Azure OpenAI-compatible endpoint

The azure_resource and deployment_id validations are now conditional -
only required when host is not provided.

Note: The host/base_url is inherited from the parent OpenAI::Options
class via alias_attribute, so we don't redeclare it as an attribute.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@TonsOfFun TonsOfFun force-pushed the feature/azure-openai-support branch from c83f97e to 8ae91e6 Compare February 6, 2026 17:43
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.

1 participant