Azure AI Foundry
Azure AI Foundry is Microsoft’s platform for accessing a wide range of AI models — from proven models such as GPT-4o, through cost-efficient options, to newer models such as DeepSeek. It offers enterprise-grade reliability, Microsoft technical support, and seamless integration with the Azure ecosystem.
When to choose Azure AI Foundry
You are already using Azure:
- your infrastructure runs in Azure,
- you want centralized cost and subscription management,
- you need integration with services such as Azure AD, Key Vault, or Application Insights.
You have enterprise requirements:
- you require high service availability,
- you need Microsoft technical support,
- you must comply with internal corporate policies.
You need flexibility in model selection:
- you want access to OpenAI models such as GPT-4o and GPT-4o-mini,
- you also want to use open-source models such as DeepSeek, Llama, or Mistral,
- you want the option to use Model Router for automatic model selection.
You want better cost control:
- you need shared TPM limits across multiple deployments,
- you want detailed usage reporting in Azure Cost Management,
- you need the ability to define budgets and alerts.
Security and compliance are important to you:
- data remains in the selected Azure region,
- the platform supports compliance with GDPR and other regulations,
- you can use private endpoints and VNET integration.
Requirements
- an Active Azure subscription,
- an Azure AI Foundry workspace with a deployed model,
- an API Key and endpoint URL.
Step 1: Prepare your Azure environment
Get access credentials
- Log in to Azure Portal.
- Go to your Azure AI Foundry workspace.
- In the menu, open Keys and Endpoint.
- Copy the following values:
- Key (API Key),
- Endpoint OpenAI URL.
Deploy a model
- In your workspace, go to Deployments.
- Click Create new deployment.
- Select a model, for example GPT-4o, GPT-4o-mini, or another model that supports the Responses API.
- Enter a deployment name (e.g.,
gpt-4o-mini). - Click Create.
Azure AI Foundry supports a variety of models, including:
- GPT models such as gpt-4o, gpt-4o-mini, gpt-35-turbo,
- Model-router, which automatically selects the most suitable model,
- DeepSeek and other models that support responses.
Step 2: Configure AI Proxy
Example aiconfiguration.json
{
"ProviderConnections": {
"AzureFoundry": {
"Description": "Azure AI Foundry Connection",
"Type": "AzureAi",
"ProviderConfiguration": {
"ApiKey": "your-azure-api-key-here",
"Endpoint": "https://your-workspace.openai.azure.com/"
}
}
},
"ProviderModels": [
{
"ConnectionName": "AzureFoundry",
"Priority": 100,
"Name": "Azure GPT-4o-mini",
"Description": "",
"TextModel": {
"ModelName": "gpt-4o-mini"
},
"ImageModel": {
"ModelName": "gpt-4o-mini"
},
"EmbeddingModel": {
"ModelName": "text-embedding-3-small"
}
}
],
"MethodTypesConfiguration": {
"ConciergePrompt": [ "Azure GPT-4o-mini" ],
"ConciergeExecuteTool": [ "Azure GPT-4o-mini" ]
}
}
In the ModelName field, enter the deployment name you created in Azure, not the underlying model name. For example, if your deployment is named my-gpt4, use "ModelName": "my-gpt4".
Example docker-compose.yml
name: aiproxy_containers
services:
ai-proxy:
image: webconbps/aiproxy:1.0.0.235
container_name: ai-proxy
restart: unless-stopped
ports:
- "5298:8080"
- "7033:8081"
environment:
- ASPNETCORE_ENVIRONMENT=Production
- AppConfiguration__SelfHosted__Certificate__Path=/app/https/certificate.pem
- Logging__LogLevel__Default=Information
- Logging__LogLevel__Microsoft=Warning
volumes:
- ./certificates/certificate.pem:/app/https/certificate.pem:ro
- ./aiconfiguration.json:/app/aiconfiguration.json:ro
Step 3: Startup
# Make sure you have prepared files
# - ./certificates/certificate.pem
# - ./aiconfiguration.json (with filled data)
# Run container
docker-compose up -d
# Check logs
docker-compose logs -f ai-proxy
Troubleshooting
Error: 401 Unauthorized
Possible causes:
- the API key is invalid,
- the endpoint URL is incorrect.
Solution:
# Check if key and endpoint are correct in aiconfiguration.json
# Verify in Azure Portal > Keys and Endpoint
# Restart container
docker-compose restart ai-proxy
Error: 404 Not Found / Model not found
Possible causes:
- the value in ModelName does not match the name of an existing deployment,
- the specified deployment does not exist or is not active.
Solution:
# Check deployment name in Azure Portal > Deployments
# Make sure deployment has "Succeeded" status
# Update ModelName in aiconfiguration.json
# Restart container
docker-compose restart ai-proxy
Error: 429 Too Many Requests
Possible cause:
- the TPM (Tokens Per Minute) limit for the selected deployment has been exceeded.
Solution:
- wait a moment before retrying,
- consider increasing the TPM limit for the deployment in Azure.
Popular models in Azure AI Foundry
When creating a deployment, you can choose from models such as:
- gpt-4o - the latest model from the GPT-4 Optimized family,
- gpt-4o-mini - a faster and more cost-efficient variant of
gpt-4o, - gpt-4-turbo - a GPT-4 model with a larger context window,
- gpt-35-turbo - a GPT-3.5 family model, listed in Azure as
gpt-35-turbo, - text-embedding-3-small - a model designed for generating embeddings,
- model-router - a mechanism for automatically selecting the most suitable model,
- deepseek and other models that support responses.
To work correctly with AI Proxy, a model must support the Responses API.