Azure OpenAI

Connect an Azure OpenAI resource to ACOG, including Azure Government, and name deployments so ACOG can route to them by model.

2 min read Updated View as Markdown Report a problem

An Azure OpenAI connection calls the deployments in your own Azure OpenAI resource.

Name deployments after their models

ACOG routes by model, and calls Azure at {endpoint}/openai/deployments/<model>/chat/completions. Each deployment must be named exactly like the model it serves, for example a deployment named gpt-4o-mini for the gpt-4o-mini model. A request for gpt-4o-mini then reaches that deployment.

Connect

  1. In the Azure portal, open your Azure OpenAI resource and copy its endpoint and one of its keys (Keys and Endpoint).
  2. In ACOG, open Admin → Providers → Connect provider, choose Azure and OpenAI, and enter:
FieldExample
Endpointhttps://my-resource.openai.azure.com (Azure Government: https://my-resource.openai.azure.us)
API version2024-10-21
API keyOne of the resource’s keys
  1. Declare the deployment names as the connection’s models and choose a default.

ACOG sends the key in the api-key header.

Optional: let ACOG read which model each deployment serves

A deployment’s name does not prove which model it runs. To bill and report on the model a deployment actually serves, give ACOG read access to the resource through Azure Resource Manager: the tenant ID, client ID and client secret of an app registration with the Reader role on the resource, and the subscription, resource group and account name. ACOG only reads deployment details with it.

Azure Government

Azure Government (GCC High and DoD) resources use the .openai.azure.us endpoint. Nothing else changes.

Calling Azure OpenAI through ACOG

Troubleshooting

What you seeCauseFix
404 DeploymentNotFound from AzureNo deployment is named after the requested modelCreate or rename the deployment to the model id
422 model_access_requiredThe model is not deployed in the resourceDeploy it, named after the model
422 upstream_auth_failedAzure rejected the stored keyPaste a current key into the connection