If you've been trying to get OpenAI's Codex CLI working with Azure OpenAI Service, you're not alone in facing configuration headaches. The ongoing transition at Azure, combined with inconsistent documentation and API version differences, can make this setup feel like navigating a maze blindfolded.
After countless hours of debugging 404 errors, stream failures, and authentication issues, here's a working configuration that actually works with Azure AI Foundry and GPT-4o.
The Codex CLI documentation provides a basic Azure configuration example, but the reality is more complex: