Considerations for Using the Azure OpenAI Services Provider
Resolved 💬 26 comments Opened Jul 12, 2025 by doggy8088 Closed Nov 2, 2025
💡 Likely answer: A maintainer (bolinfest, collaborator)
responded on this thread — see the highlighted reply below.
For the latest Node.js version, I was getting source code to build codex-cli folder. Here are some notes:
~/.codex/config.json
The model must be your deployment name. It's not a "Model name".
``json``
{
"model": "codex-mini",
"provider": "azure"
}
~/.profile
``shell``
# Codex CLI
export AZURE_OPENAI_API_KEY='your-api-key'
export AZURE_BASE_URL="https://your-resource-name.openai.azure.com/openai"
Only o4-mini and codex-mini models able to use Responses API.
If I get codex v0.5.0 by npm install -g @openai/codex, I still can't run with Azure OpenAI. I tried everything. It just can't run.
<img width="1918" height="1207" alt="Image" src="https://github.com/user-attachments/assets/8ca096ea-212a-4c40-a0d5-64c25f01ac64" />
26 Comments
For the Rust version, this is my toml configuration. It works with all the models listed here from my Azure deployment:
@kingdomseed The only different seems only the
base_url.My:
https://YOUR_ENDPOINT.openai.azure.com/openaiYours:
https://YOUR_ENDPOINT.cognitiveservices.azure.com/openaiI tried both. All failed. Still the same error.
Are you install codex 0.5.0 by
npm install -g @openai/codex?<img width="771" height="129" alt="Image" src="https://github.com/user-attachments/assets/23e001b6-3b0f-4e73-b272-d68fa7fa93f2" />
@kingdomseed I successfully compiled the Rust source, and it runs smoothly with Azure OpenAI. Thanks. The published
@openai/codexpackage is buggy on Azure OpenAI.I've just realized that the
npm install -g @openai/codexcommand is actually install the Rust version.The 0.5.0 still broken for Azure OpenAI Service. If I build from Source, everything will be all right.
I installed using homebrew (I'm running on macOS)--I'm on 0.5.0. I'm using
.cognitiveservices.azure.com/openaiand the wire_api=responses. Do you know if the openai.azure.com supports responses on the wire_api or only chat/compeltions?I know. It is supported Responses API.
@kingdomseed I'm using Linux. Do you know why I can only access Azure OpenAI by building it from Rust source code?
I don't--I know they had some issues with NPM for Rust version but I thought it was corrected in 0.5.0. Maybe someone else can chime in on this.
I upgraded to codex-cli 0.6.0.
It still failed with Azure OpenAI Service setup.
<img width="1914" height="1234" alt="Image" src="https://github.com/user-attachments/assets/38d6b97e-d17e-43be-9472-7b20ef2f5402" />
If I download the Linux binary, it works! 😅
<img width="1042" height="615" alt="Image" src="https://github.com/user-attachments/assets/2443d539-7963-4374-8ed8-66ad64dcc6a0" />
It must be something wrong with the npm package! 🔥🔥🔥
Also, the DotSlash version still has the same issue. I suspect it might be related to a Environment Variables problem.
I checked the DotSlash cache and the file directly download from GitHub Release for 0.6.0 version.
Check for .tar.gz file
Unzip it:
The file size is
17235880.<img width="1240" height="210" alt="Image" src="https://github.com/user-attachments/assets/1429c7cc-edc3-43d0-b7a8-eaa9e41880c4" />
This version works!
<img width="1468" height="584" alt="Image" src="https://github.com/user-attachments/assets/25d71112-23fa-4643-893a-6a2f4ab2bf9e" />
Check for DotSlash
Find
linux-x86_64and get the url: <https://github.com/openai/codex/releases/download/rust-v0.6.0/codex-x86_64-unknown-linux-musl.zst>Download it:
Unzip it:
The file size is
22904768.<img width="1251" height="205" alt="Image" src="https://github.com/user-attachments/assets/0a11ea09-a45e-433e-b0a6-6212d07bb8c1" />
This version not works!
<img width="1950" height="849" alt="Image" src="https://github.com/user-attachments/assets/1b4c16af-5799-4379-8ed7-8add61217beb" />
The result
I think
muslversion have some issues. Thegnuversion is correct.If the npm package include the
gnuversion, I think the problem will be solved as well. Please consider fix the bug or change another target.By the way, can I choose which target I can use for npm package?
The
@openai/codex v0.6.0do packed withcodex-x86_64-unknown-linux-muslfor linux.<img width="1452" height="486" alt="Image" src="https://github.com/user-attachments/assets/6655d527-227f-4184-a489-352bcd1c5ea6" />
Can the team switch to the GNU version?
please for the love of god, include basic automated testing for azure so it does not break every other update.
Azure OpenAI is always a second-class citizen. 😑
There was a known issue with 0.5.0 only if you used the npm version: https://github.com/openai/codex/pull/1568.
@doggy8088
The GNU version inevitably doesn't work for some people because of libc differences:
muslis a better "universal binary" for Linux in our experience.I'm using Ubuntu 22.04.5 LTS on WSL. When I install codex by:
npm i -g @openai/codex, I just can't use Azure OpenAI. I installedcodex-cli 0.27.0. I tested with this version today.This issue has been over a month. The
msulversion just can't connect to Azure OpenAI correctly. I don't know why. Does anyone able to look at it? @seratchInstall Ubuntu-24.04 distro on Windows 10 (WSL)
Confirm the OS version
Install NVM
Install Codex CLI
Setup
~/.codex/config.tomlSetup
AZURE_OPENAI_API_KEYenvironment variable for your AOAI API Key.Try to use Codex CLI
You can easily reproduce this issue now!
<img width="2364" height="1243" alt="Image" src="https://github.com/user-attachments/assets/1887b710-384f-4c59-bb08-b76bf818d7c9" />
Note: The real codex path is defined here:
$NVM_BIN/codex<img width="767" height="830" alt="Image" src="https://github.com/user-attachments/assets/5f8bdef9-51f3-48ef-a97c-c4e151c0e1ba" />
I hope this issue can be resolved. Can someone from OpenAI respond to this? Thank you!
More logs for you guys:
Logs
I checked TLS handshake and certificates. It's all okay.
I finally confirmed that is a DNS resolve issue from
msulimplementation.Programs built with musl libc cannot reliably resolve Azure OpenAI (AOAI) service endpoints due to fundamental limitations in musl's DNS resolver implementation. This issue stems from musl's inability to handle complex DNS queries that exceed UDP packet size limitations, which are common with Azure's sophisticated DNS infrastructure.
Here is the sample DNS query for AOAI endpoint:
When using the
msulbuild, it will unable to handle this issue. I don't know how to fix it.Workaround
To work around the issue, you can add a statically mapped DNS record to the
/etc/hostsfile.Here is a snippet that can be added to the ~.bashrc to automatically perform the etc/hosts modification, :
usage:
vi ~.bashrc
change the last line to your azure openai domain and insert code to the bottom:
I'm one-liner.
Thanks for all the discussion on this topic. I'm going to close this bug at this point because it's not clear that there's anything actionable. If there's anything specific that you'd like to see in terms of bug fixes, documentation improvements, or enhancements related to the Azure OpenAI service provider, please file new issues so we can prioritize and track them.
Hi @etraut-openai
I conducted numerous tests and provided a workaround. It's evident that actions can be taken, as the issue appears to be related to DNS. You can either update the README.md or address the issues in Codex CLI. These are viable solutions.
I spent a considerable amount of time addressing the issue and eventually discovered a workaround. I sincerely hope the Codex CLI can be improved. The Codex CLI is an open source software. If no one in the OpenAI understands what I am doing, we can discuss this issue rather than directly closing it. I am very disappointed with this behavior.
How is this in any way completed/closeable?
This issue was opened prior to the rewrite of Codex in Rust. The code base has changed significantly since then. This is also a very broad issue, and the conversation has covered a lot of different areas. Issues like this tend to languish and not get attention from the codex team because they're so broad. My goal is to ensure that the top-priority issues that are affecting codex users are getting the appropriate attention.
@doggy8088, thanks for your work looking into the DNS issue. I've created a fresh issue here specific to this issue. This should help focus the attention on the DNS issue in particular. Feel free to add any corrections or additions that you think would be helpful. It looks like this DNS issue is the primary issue affecting Azure OpenAI users, based on upvotes/reactions.
If there are other specific issues related to the Azure OpenAI endpoint, let's make sure that there are targeted bug reports for those issues. This will help ensure that they get attention. Thanks!
Incidentally, I just merged a bug fix submitted by @tombl that should improve rate limit behaviors when using the Azure OpenAI endpoint. That fix will be included in the next CLI release.