Azure OpenAI Setup
Self-Hosting Documentation Access
This section requires a password to access. Interested in self-hosting? Contact sales to learn more.
LlamaCloud supports Azure OpenAI as an enterprise-grade alternative to OpenAI for organizations requiring enhanced compliance, security, and private deployments. This page guides you through configuring Azure OpenAI integration with your self-hosted LlamaCloud deployment.
Prerequisites
Section titled “Prerequisites”- A valid Azure OpenAI account
- Azure OpenAI resource deployed in Azure
- Access and quota for the supported models:
gpt-4ogpt-4o-minigpt-4.1gpt-4.1-minigpt-4.1-nanogpt-5gpt-5-minigpt-5-nanotext-embedding-3-smalltext-embedding-3-largewhisper-1
Environment Variables
Section titled “Environment Variables”Azure OpenAI supports per-model configuration using environment variables. Each model uses its own set of credentials:
Environment Variable Pattern
Section titled “Environment Variable Pattern”AZURE_OPENAI_<MODEL_NAME>_API_KEY- Deployment API keyAZURE_OPENAI_<MODEL_NAME>_BASE_URL- Azure OpenAI endpointAZURE_OPENAI_<MODEL_NAME>_DEPLOYMENT_NAME- Deployment name (not model name)AZURE_OPENAI_<MODEL_NAME>_API_VERSION- API version
Supported Models
Section titled “Supported Models”- GPT-4o:
AZURE_OPENAI_GPT_4O_* - GPT-4o Mini:
AZURE_OPENAI_GPT_4O_MINI_* - GPT-4.1:
AZURE_OPENAI_GPT_4_1_* - GPT-4.1 Mini:
AZURE_OPENAI_GPT_4_1_MINI_* - GPT-4.1 Nano:
AZURE_OPENAI_GPT_4_1_NANO_* - GPT-5:
AZURE_OPENAI_GPT_5_* - GPT-5 Mini:
AZURE_OPENAI_GPT_5_MINI_* - GPT-5 Nano:
AZURE_OPENAI_GPT_5_NANO_* - Text Embedding 3 Small:
AZURE_OPENAI_TEXT_EMBEDDING_3_SMALL_* - Text Embedding 3 Large:
AZURE_OPENAI_TEXT_EMBEDDING_3_LARGE_* - Whisper 1:
AZURE_OPENAI_WHISPER_1_*
Configuration
Section titled “Configuration”Azure OpenAI uses per-model configuration with separate credentials for each model. Follow these steps:
Step 1: Gather Azure OpenAI Information
Section titled “Step 1: Gather Azure OpenAI Information”For each model you want to use, collect:
- API Key: From your Azure OpenAI resource’s “Keys and Endpoint” section
- Base URL: Your Azure endpoint (e.g.,
https://your-resource.openai.azure.com) - Deployment Name: The name of your model deployment (not the model name)
- API Version: Current version is
2024-12-01-preview
Step 2: Create Kubernetes Secret
Section titled “Step 2: Create Kubernetes Secret”Create a secret with your Azure OpenAI credentials for each model:
apiVersion: v1kind: Secretmetadata: name: azure-openai-credentialstype: OpaquestringData: # GPT-4o configuration AZURE_OPENAI_GPT_4O_API_KEY: "your-gpt-4o-api-key" AZURE_OPENAI_GPT_4O_BASE_URL: "https://your-resource.openai.azure.com" AZURE_OPENAI_GPT_4O_DEPLOYMENT_NAME: "your-gpt-4o-deployment" AZURE_OPENAI_GPT_4O_API_VERSION: "2024-12-01-preview"
# GPT-4o Mini configuration AZURE_OPENAI_GPT_4O_MINI_API_KEY: "your-gpt-4o-mini-api-key" AZURE_OPENAI_GPT_4O_MINI_BASE_URL: "https://your-resource.openai.azure.com" AZURE_OPENAI_GPT_4O_MINI_DEPLOYMENT_NAME: "your-gpt-4o-mini-deployment" AZURE_OPENAI_GPT_4O_MINI_API_VERSION: "2024-12-01-preview"
# Add other models as needed...Apply the secret:
kubectl apply -f azure-openai-secret.yamlStep 3: Configure Helm Values
Section titled “Step 3: Configure Helm Values”Reference the secret in your Helm configuration:
config: llms: azureOpenAi: secret: "azure-openai-credentials"Direct Configuration
config: llms: azureOpenAi: deployments: [] # - model: "gpt-4o-mini" # deploymentName: "gpt-4o-mini" # apiKey: "" # baseUrl: "https://api.openai.com/v1" # apiVersion: "2024-08-06"Finding Azure OpenAI Configuration Values
Section titled “Finding Azure OpenAI Configuration Values”Base URL
Section titled “Base URL”- Go to your Azure OpenAI resource in the Azure Portal
- Navigate to Resource Management → Keys and Endpoint
- Copy the Endpoint value (format:
https://your-resource.openai.azure.com)
API Key
Section titled “API Key”- In the same Keys and Endpoint section
- Copy either KEY 1 or KEY 2
Deployment Name
Section titled “Deployment Name”- Go to Model deployments in your Azure OpenAI resource
- Use the Deployment name (not the Model name)
- Example: If you have a deployment called “my-gpt-4o” using the “gpt-4o” model, use “my-gpt-4o”
API Version
Section titled “API Version”- Use the latest stable version:
2024-12-01-preview - Check Azure OpenAI API reference for current versions
Verification
Section titled “Verification”After configuration, verify your Azure OpenAI integration:
-
Verify in Admin UI: Check available models in the LlamaCloud admin interface
-
Test functionality: Upload a document to confirm Azure OpenAI models are working
Troubleshooting
Section titled “Troubleshooting”Common Issues
Section titled “Common Issues”Authentication Errors
Section titled “Authentication Errors”Error: Access denied due to invalid subscription keySolution:
- Verify your API key is correct
- Ensure the key hasn’t expired
- Check that you’re using the right key for the deployment
Deployment Not Found
Section titled “Deployment Not Found”Error: The API deployment for this resource does not existSolution:
- Verify the deployment name exactly matches what’s in Azure
- Check that the deployment is in the same region as your resource
- Ensure the deployment is not paused or stopped
API Version Issues
Section titled “API Version Issues”Error: Invalid API version specifiedSolution:
- Use a supported API version (e.g.,
2024-12-01-preview) - Check Azure OpenAI documentation for current versions
Rate Limiting
Section titled “Rate Limiting”Error: Rate limit exceededSolution:
- Check your Azure OpenAI quotas
- Consider upgrading your deployment tier
- Implement request throttling
Debug Steps
Section titled “Debug Steps”-
Test endpoint directly:
Terminal window curl -H "api-key: YOUR_KEY" \"https://YOUR_RESOURCE.openai.azure.com/openai/deployments/YOUR_DEPLOYMENT/completions?api-version=2024-12-01-preview" -
Verify secret mounting:
Terminal window kubectl get secret your-azure-openai-secret -o yamlkubectl describe pod <pod-name> | grep -A 20 Environment -
Check network connectivity: Ensure your cluster can reach your Azure OpenAI endpoint