Formerly known as Azure AI Services or Azure Cognitive Services is a unified collection of prebuilt AI capabilities within the Microsoft Foundry platform
Hello Avnish !
Thank you for posting on Microsoft Learn Q&A.
You need to install the Codex CLI :
# either one works
npm install -g @openai/codex
codex --version
brew install codex
codex --version
https://developers.openai.com/codex/cli/
Codex needs a provider block and must talk to the v1 Responses endpoint (note the /openai/v1 path and no api-version query).
https://learn.microsoft.com/en-us/azure/ai-foundry/openai/how-to/codex
# ~/.codex/config.toml
model = "gpt-5-codex" # or your deployment name
model_provider = "azure"
model_reasoning_effort = "medium"
[model_providers.azure]
name = "Azure OpenAI"
base_url = "https://YOUR_RESOURCE_NAME.openai.azure.com/openai/v1"
env_key = "AZURE_OPENAI_API_KEY"
wire_api = "responses"
Then export your Azure OpenAI resource key since Entra ID auth isn’t supported by Codex yet :
# Linux/macOS/WSL
export AZURE_OPENAI_API_KEY="YOUR_AOAI_KEY"