azure://¶
Azure OpenAI Service
— OpenAI's model line-up hosted on Azure with IAM, regional residency,
private networking, and per-deployment naming. The wire format is
OpenAI-compatible but the URL pattern and auth header differ from
openai://, so Azure has its own scheme.
The key Azure-specific quirks this component handles:
- URL:
{baseURL}/openai/deployments/{model}/chat/completions?api-version={apiVersion} - Auth header:
api-key: <key>(notAuthorization: Bearer <key>). baseURLis required — there is no default Azure endpoint.
URI shape¶
azure://chat?model=<deployment>&apiKey=<key>&baseURL=https://<resource>.openai.azure.com&apiVersion=<version>
The model parameter on Azure refers to the deployment name you
chose in the Azure portal, not the model family — e.g. you might
deploy GPT-4o under the deployment name prod-gpt4o.
Parameters¶
| Param | Type | Default | Producer/Consumer/Both | Description |
|---|---|---|---|---|
model |
string | gpt-4o |
Producer | Azure deployment name (NOT the OpenAI model id). |
apiKey |
string | (from constructor) | Producer | Azure OpenAI resource key. Sent as api-key header. |
baseURL |
string | required, no default | Producer | Your Azure resource endpoint, e.g. https://my-resource.openai.azure.com. URI creation fails if unset. |
apiVersion |
string | 2024-10-21 |
Producer | Azure REST API version. Pin to a supported version. |
temperature |
float | 0.7 |
Producer | Sampling temperature. |
maxTokens |
int | 4096 |
Producer | Output cap. |
Operation defaults to chat; embeddings is not supported on this
scheme (use a deployment of text-embedding-3-* via the OpenAI
scheme with baseURL pointed at Azure, or wait for the Azure
embeddings code path).
Headers¶
Reads:
| Header | Effect |
|---|---|
systemPrompt |
Prepended as a role: system message. |
Sets:
| Header | Description |
|---|---|
azure.model |
The deployment name used. |
azure.id |
OpenAI-shaped completion id. |
azure.finishReason |
stop, length, content_filter, etc. |
azure.usage.promptTokens / completionTokens / totalTokens |
Token billing. |
Examples¶
- id: azure-chat
from: direct://chat
steps:
- to: azure://chat?model=prod-gpt4o&baseURL=https://my-resource.openai.azure.com&apiKey=${AZURE_OPENAI_KEY}
Pin a specific API version (recommended for production stability):
- to: azure://chat?model=prod-gpt4o&baseURL=https://my-resource.openai.azure.com&apiVersion=2024-10-21&apiKey=${AZURE_OPENAI_KEY}
Behavior notes¶
- The Azure response shape is OpenAI-compatible — the component
uses
llmutil.ChatRequest/ChatResponse/APIErrortypes directly. baseURLis required. Helix rejects the URI at creation time if unset; there's no "default Azure endpoint".- Azure AD / managed-identity auth is not supported on this scheme — only key-based auth. For AAD-token auth, run the route on a host inside the Azure VNet and bridge via an Azure API Management policy that swaps tokens for keys.
- No embeddings, no streaming, no DALL-E on this scheme.
- 120s timeout. No retries.
Source¶
pkg/component/azure/azure.gopkg/component/azure/azure_test.go
See also¶
openai— the hosted OpenAI scheme.- providers guide.