Skip to main content

Azure OpenAI

Overview

Azure OpenAI Service provides access to OpenAI's models through Microsoft Azure infrastructure. AI Gateway can be configured to use Azure OpenAI for various AI operations with your Azure infrastructure.

Configuration

To use Azure OpenAI, configure it in the Plugin settings page under the AI Gateway section:

FieldDescriptionExample
API KeyYour Azure API keyyour-azure-api-key
Resource NameUsed in URL: https://{resourceName}.openai.azure.com/openai/v1your-resource-name
API VersionOptional, defaults to preview2024-02-15-preview
Base URLOptional, to point at a gateway (overrides resourceName when provided)https://ai-gateway.example.com/azure
HeadersOptional, e.g. for authentication with gatewayKey: X-Custom-Header
Value: custom-value

Then set the default language model (using your Azure deployment name):

Language Model: azure|your-deployment-name

Azure Setup

Prerequisites

  • Azure subscription with access to create Azure OpenAI resources
  • Model availability varies by region

1. Create Azure OpenAI Resource

  1. Sign in to Azure Portal
  2. Select "Create a resource" and search for "Azure OpenAI"
  3. Configure the resource:
    • Choose your subscription
    • Select or create a resource group
    • Choose a region
    • Name your resource
    • Select a pricing tier
  4. Complete the resource creation

2. Deploy a Model

  1. Sign in to Azure AI Foundry portal
  2. Select your subscription and OpenAI resource
  3. Navigate to "Deployments"
  4. Click "Create new deployment"
  5. Select a model (e.g., gpt-4, gpt-4o, gpt-35-turbo)
  6. Enter a deployment name (you'll use this in your configuration)
  7. Configure deployment settings
  8. Click "Create"

3. Get API Key and Resource Name

  1. In the Azure Portal, go to your Azure OpenAI resource
  2. Navigate to "Keys and Endpoint"
  3. Copy either KEY 1 or KEY 2
  4. Note your resource name from the resource overview

Example Configuration

In Plugin Settings → AI Gateway → Azure:

  • API Key: abc123...
  • Resource Name: my-openai-resource
  • API Version: 2024-02-15-preview

In Default Models:

  • Language Model: azure|gpt-4-deployment (Use your deployment name, not the model name)

Important Notes

  • Deployment Name vs Model Name: Use your deployment name in the configuration, not the underlying model name
  • API Version: Azure OpenAI uses API versions. The default is usually fine, but you can specify a specific version if needed
  • Resource Name vs Base URL: You can use either resourceName (simpler) or baseURL (for custom endpoints/gateways). When baseURL is provided, resourceName is ignored

For more information, refer to the Azure OpenAI documentation.