Skip to content

Azure AI Foundry

Avant exchanges the workspace’s assertion with Entra ID for an access token, using a federated credential on your app registration or managed identity. No client secret exists. Read How provider setup works first.

  • An Azure AI Foundry resource. Its endpoint looks like https://<name>.services.ai.azure.com.
  • An Entra app registration (or a user-assigned managed identity) with a service principal.
  • A deployment for every model you want to use, named exactly after the model id (for example claude-sonnet-5). Avant sends the model id as the deployment name.
Terminal window
CLIENT_ID="<application-client-id>"
BINDING_SUBJECT="avant:binding:..."
az ad sp show --id "$CLIENT_ID" >/dev/null 2>&1 || az ad sp create --id "$CLIENT_ID"
az ad app federated-credential create --id "$CLIENT_ID" --parameters '{
"name": "avant-byoc",
"issuer": "https://identity.avant.codes",
"subject": "'"$BINDING_SUBJECT"'",
"audiences": ["api://AzureADTokenExchange"]
}'
az role assignment create --assignee "$CLIENT_ID" \
--role "Cognitive Services User" --scope <foundry-resource-id>
  • az ad app create makes an app without a service principal. Entra won’t issue a token for it (AADSTS7000229) and won’t accept a role assignment, so the first line creates one if it’s missing.
  • Never create a client secret. The federated credential replaces it.

With a user-assigned managed identity, skip the first two commands and run:

Terminal window
az identity federated-credential create --name avant-byoc \
--identity-name <identity> --resource-group <rg> \
--issuer https://identity.avant.codes --subject "$BINDING_SUBJECT" \
--audiences api://AzureADTokenExchange
Field Value
Foundry resource endpoint https://<name>.services.ai.azure.com
Azure region The resource’s region, such as swedencentral
Entra tenant ID Your tenant’s UUID
Entra application (client) ID The client id, not the object id
Terminal window
avant workspace create --name foundry --mode byoc-azure \
--endpoint https://my-foundry.services.ai.azure.com --location swedencentral \
--tenant-id <tenant-uuid> --client-id <client-uuid>
avant workspace verify foundry

Verify gets an Entra token and sends one request to the workspace’s default model, so that deployment has to exist.

Foundry has no cross-region profiles. Set the policy’s Inference location to the workspace’s region.

Claude models use the Messages API. GPT and other models use Chat Completions, and Responses where the table says so.

ModelAPILocationsHarnesses
claude-sonnet-5MessagesAnyClaude Code, OpenCode, Pi, Oh My Pi
claude-sonnet-5-5 (default)MessagesAnyClaude Code, OpenCode, Pi, Oh My Pi
claude-haiku-5-5MessagesAnyClaude Code, OpenCode, Pi, Oh My Pi
gpt-6.1-solChat Completions, ResponsesAnyCodex, OpenCode, Pi, Oh My Pi

Delete the federated credential or the role assignment.