Azure OpenAI Provider
Azure OpenAI Service provides OpenAI models through Microsoft Azure, with enterprise security, compliance, and regional data residency.
Prerequisites
- An Azure subscription
- Access granted to Azure OpenAI Service (request via Azure portal)
- A deployed model in your Azure OpenAI resource
Set Up a Deployment
- Go to Azure AI Studio or the Azure portal
- Create an Azure OpenAI resource
- Navigate to Deployments and deploy a model (e.g.,
gpt-4o) - Note your:
- Resource name (e.g.,
my-company-openai) - Deployment name (e.g.,
gpt-4o) - API key (found under Keys and Endpoint)
- Resource name (e.g.,
Configure VibeCody
Option 1: Environment variable
export AZURE_OPENAI_API_KEY="your-key-here"
vibecli --provider azure_openai
Option 2: Config file (~/.vibecli/config.toml)
[azure_openai]
enabled = true
api_key = "your-key-here"
api_url = "https://my-company-openai.openai.azure.com"
model = "gpt-4o"
The model field should match your Azure deployment name. The api_url is your resource endpoint.
Model Selection
Available models depend on what you have deployed in your Azure resource:
| Model | Strengths | Best for |
|---|---|---|
gpt-4o |
Strongest reasoning | Complex coding, architecture |
gpt-4o-mini |
Fast and affordable | Daily coding tasks |
o3-mini |
Chain-of-thought reasoning | Hard debugging, logic |
Default: gpt-4o
Best For
- Enterprise compliance – data stays within your Azure tenant and chosen region
- Private networking – use with VNETs and private endpoints
- Existing Azure infrastructure – integrates with Azure AD, RBAC, and monitoring
- Data residency – choose specific Azure regions for data locality requirements
Verify Connection
vibecli --provider azure_openai -c "List 3 advantages of using Azure for AI workloads"
Troubleshooting
401 Unauthorized
- Verify your API key under Keys and Endpoint in the Azure portal
- Confirm the env var is set:
echo $AZURE_OPENAI_API_KEY
404 Resource Not Found
- Check that
api_urlmatches your resource endpoint exactly - Verify the deployment name in
modelmatches an active deployment
403 Forbidden
- Your Azure subscription may not have Azure OpenAI access approved
- Check region availability – not all models are available in all regions