Skip to content

For the complete documentation index, see llms.txt. Markdown versions of all docs pages are available by appending .md to any docs URL.

Page as Markdown

Azure

Configuration and setup for Azure AI services provider

Configure Microsoft Azure AI as an LLM provider in agentgateway.

Authentication

Before you can use Azure as an LLM provider, you must authenticate by using one of the standard Azure authentication methods. By default, agentgateway uses DefaultAzureCredential which automatically detects credentials from the environment (Azure CLI, managed identity, workload identity, or environment variables). You can also authenticate with an API key.

Configuration

Azure supports two endpoint types:

  • Azure AI Foundry (Foundry): Connect to Azure AI Foundry project endpoints at {resourceName}-resource.services.ai.azure.com.
  • Azure OpenAI (OpenAI): Connect directly to Azure OpenAI Service deployments at {resourceName}.openai.azure.com.
Review the following example configuration.
# yaml-language-server: $schema=https://agentgateway.dev/schema/config
llm:
  models:
  - name: "*"
    provider: azure
    params:
      azureResourceName: "your-resource-name"
      azureResourceType: Foundry
      azureProjectName: "your-project-name"
Review the following example configuration.
SettingDescription
nameThe model name to match in incoming requests. When a client sends "model": "<name>", the request is routed to this provider. Use * to match any model name.
providerThe LLM provider, set to azure for Azure AI models.
params.azureResourceNameThe Azure resource name used to construct the endpoint hostname.
params.azureResourceTypeThe endpoint type: Foundry for Azure AI Foundry, or OpenAI for Azure OpenAI Service.
params.azureProjectNameThe Foundry project name. Required for Foundry type. If omitted, defaults to azureResourceName.
params.azureApiVersionOptional API version override. Defaults to v1. For legacy deployments, use a dated version like 2024-04-01-preview.
params.modelThe specific Azure model to use. If set, this model is used for all requests. If not set, the request must include the model to use.
params.apiKeyThe Azure API key for authentication. If unset, implicit Entra ID authentication is used. You can reference environment variables using the $VAR_NAME syntax.

Advanced configuration

For advanced Azure AI scenarios, use the traditional listener/route configuration format. The following tabs show examples for different authentication methods.

Azure AI Foundry with implicit auth: Use DefaultAzureCredential to automatically detect credentials from the environment (Azure CLI, managed identity, workload identity, or environment variables).

# yaml-language-server: $schema=https://agentgateway.dev/schema/config
binds:
- port: 3000
  listeners:
  - routes:
    - matches:
      - path:
          pathPrefix: /azure
      policies:
        urlRewrite:
          authority: auto
        backendAuth:
          azure:
            implicit: {}
        backendTLS: {}
      backends:
      - ai:
          name: azure
          provider:
            azure:
              resourceName: "your-resource-name"
              projectName: "your-project-name"
              resourceType: Foundry
              model: gpt-4.1

Review the following example configuration.

SettingDescription
ai.nameThe name of the LLM provider for this AI backend.
ai.provider.azure.resourceNameThe Azure resource name used to construct the endpoint hostname.
ai.provider.azure.resourceTypeThe endpoint type: foundry for Azure AI Foundry, or openAI for Azure OpenAI Service.
ai.provider.azure.projectNameThe Foundry project name. Required for foundry type.
ai.provider.azure.modelOptionally set the model to use for requests. If set, any models in the request are overwritten. If not set, the request must include the model to use.
backendAuth.azure.implicitUse implicit authentication via DefaultAzureCredential, which automatically detects credentials from the environment.
Was this page helpful?
Agentgateway assistant

Ask me anything about agentgateway configuration, features, or usage.

Note: AI-generated content might contain errors; please verify and test all returned information.

Tip: one topic per conversation gives the best results. Use the + button in the chat header to start a new conversation.

Switching topics? Starting a new conversation improves accuracy.
↑↓ navigate select esc dismiss

What could be improved?

Your feedback helps us improve assistant answers and identify docs gaps we should fix.

Need more help? Join us on Discord: https://discord.gg/y9efgEmppm

Want to use your own agent? Add the Solo MCP server to query our docs directly. Get started here: https://search.solo.io/.