Fabric
Fabric copied to clipboard
[Bug]: Cannot use Azure OpenAI's gpt4.1
What happened?
I have updated the .env file with all the right parameters for leveraging Azure OpenAI's gpt4.1 model and I keep on getting this error:
" error, status code: 404, status: 404 Not Found, message: The API deployment for this resource does not exist. If you created the deployment within the last 5 minutes, please wait a moment and try again. "
The same parameters works in my other application.
Version check
- [x] Yes I was.
Relevant log output
error, status code: 404, status: 404 Not Found, message: The API deployment for this resource does not exist. If you created the deployment within the last 5 minutes, please wait a moment and try again.
Relevant screenshots (optional)
No response
What happened?
I have updated the .env file with all the right parameters for leveraging Azure OpenAI's gpt4.1 model and I keep on getting this error:
" error, status code: 404, status: 404 Not Found, message: The API deployment for this resource does not exist. If you created the deployment within the last 5 minutes, please wait a moment and try again. "
The same parameters works in my other application.
Version check
- [x] Yes I was.
Relevant log output
error, status code: 404, status: 404 Not Found, message: The API deployment for this resource does not exist. If you created the deployment within the last 5 minutes, please wait a moment and try again.
Relevant screenshots (optional)
No response
I was confused for a moment when you said "Azure OpenAI's gpt4.1 model" but I quickly learned that Azure ports selected Open AI models through their services. So, in an attempt to clear up any confusion, let's back up and make sure you are starting out corretly...
A quick search revelealed that Microsoft Azure has a product called Azure OpenAI Service, which gives users access to OpenAI’s models — GPT-3.5, GPT-4, Codex, DALL·E, etc. — hosted on Microsoft’s infrastructure. So when you say:
"I'm using Azure OpenAI's GPT-4.1"
You probably mean that you deployed GPT-4 (or 4.1 IF that version is supported) using Azure’s OpenAI API.
Now, about the error: "404 Not Found: The API deployment for this resource does not exist"
It turns out, this is a common Azure OpenAI setup issue, and another quick search said it usually means one of the following:
1. Incorrect deployment name.
Azure requires you to create a deployment for a model (e.g., gpt-4-32k) and give it a custom deployment name, like "gpt4prod" or "gpt-4-test".
The API call must reference your custom deployment name, not just the model name.
2. Wrong endpoint URL.
The endpoint should look like:
https://
((this looks odd to me, but this endpoint is what searches gave to me...))
If you're using regular OpenAI API endpoint (api.openai.com) it won’t work — Azure has its own endpoint structure.
3. Model not deployed (yet).
If they just created the deployment, it may take a few minutes for it to become available. I doubt this is your trouble.
4. Wrong API version.
Azure OpenAI is strict about API versions. The api-version query parameter must match the supported API version (e.g., 2024-04-01). I don't know how big of a bump this issue will make, but it's possible I guess...
Azure OpenAI is a Microsoft-hosted API for OpenAI models, and some searches say this error is almost always a mismatch between the endpoint and deployment name.
Be sure to verify
In your .env file, you should check: (located ~/.config/fabric/.env)
AZURE_OPENAI_API_KEY=your-key
AZURE_OPENAI_ENDPOINT=https://your-resource-name.openai.azure.com/
AZURE_OPENAI_DEPLOYMENT=gpt-4-prod
AZURE_OPENAI_API_VERSION=2024-04-01
Assuming your deployment name is gpt-4-prob, of course. And i don't know if the Fabric/Azure connection uses _API-VERSION= or not, but from the search it seems a requirement from Azure. If this is missing (as in Fabric doesn't create this in your .env) then that is a compatibility issue, and that will have to be reported as an official bug on it's own.
LMK if all of that above makes sense or not. I'm not always the best as explaining...
GPT 4o working all ok, but the API version is failing on o1 and 4.1, I have tried the API_VERSION=2024-12-01-preview, but this is not being passed to Azure
I seem to have fixed it for some reason, create the deployment removing and the decimal point and it should work.
So gpt41 will work.
gpt-4.1 will not work
i got it working with AZURE_DEPLOYMENTS=gpt41 AZURE_API_VERSION=2024-12-01-preview as well.
but, the decimal also breaks the DEFAULT_MODEL, so i had to make it DEFAULT_MODEL=gpt-4o
is this consistent with your experience @infinitelyloopy-bt ?
edit: noticing DEFAULT_MODEL=gpt41 also works, so maybe it's not important.
Again, this version of fabric v1.4.264 broke the working use of Azure OpenAI.
I upgraded and when I ran fabric, I got this error:
POST "https://xxxxxxxxxxxxxxxx.cognitiveservices.azure.com/chat/completions?api-version=2024-12-01-preview": 404 Not Found {"code":"404","message": "Resource not found"}
I removed my domain from the URL.
It was working perfectly with the previous Fabric version.
Hi @infinitelyloopy-bt there is nothing AZURE related in the recent changes - I'd appreciate some guidance from Azure users on this to see how I can make fabric better for you.
What was your previous working version number? @infinitelyloopy-bt
@infinitelyloopy-bt Did you get this fixed? I don't have Azure working on my end so I am relying on you and other Azure users.