End-to-end examples for Entra ID (AAD)

Resolved 💬 1 comment Opened Jan 27, 2026 by c0okB Closed Jan 27, 2026

What feature would you like to see?

Support for connecting to Azure OpenAI using Entra ID

# 1) mint an AAD access token (raw JWT, no "Bearer ")
export AZURE_OPENAI_API_KEY="$(python - <<'PY'
from azure.identity import ClientSecretCredential
cred = ClientSecretCredential(
    tenant_id="<TENANT_ID>",
    client_id="<CLIENT_ID>",
    client_secret="<CLIENT_SECRET>",
)
print(cred.get_token("https://cognitiveservices.azure.com/.default").token)
PY
)"

# 2) run Codex with Azure profile and deployment name
codex --profile azure -m "<AZURE_DEPLOYMENT_NAME>" "hello from client credentials"

Additional information

_No response_

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗