⚠️ 404 Not Found Azure OpenAI / Microsoft Foundry .NET 10
✓ Verified Oct 2026
Fix: Azure OpenAI 404 The API Deployment Does Not Exist
Fix Azure OpenAI 404 deployment not found error in C#. Solve deployment name vs model name confusion in AzureOpenAIClient and Semantic Kernel.
Raw Error Payload / Console String
{
"error": {
"code": "DeploymentNotFound",
"message": "The API deployment for this resource does not exist. If you created the deployment recently, please wait a few minutes and try again."
}
} Trigger Scenario
Calling client.GetChatClient("gpt-4o") using the underlying foundation model name instead of the custom deployment name created in Microsoft Foundry.
Root Cause
Azure OpenAI routes requests by Deployment Name, not Model Name. If your deployment in the portal is named 'my-gpt4o-prod', passing 'gpt-4o' causes a 404.
Step-by-Step Resolution
1
Check deployment name in Microsoft Foundry Log into Microsoft Foundry > Deployments and verify the exact custom name string.
2
Pass custom deployment string in C# Pass the exact deployment name into client.GetChatClient("my-gpt4o-prod").
3
Verify regional endpoint Confirm your endpoint URI matches the specific Azure region where the deployment was created.
Verified C# (.NET 10) Solution Code
// INCORRECT: client.GetChatClient("gpt-4o"); // 404 if deployment is named differently
// CORRECT: Use the exact Deployment Name from Microsoft Foundry portal
string deploymentName = "prod-gpt4o-deployment";
var chatClient = azureOpenAIClient.GetChatClient(deploymentName);
var result = await chatClient.CompleteChatAsync("Test prompt");
Comprehensive Engineering Guide
Read Full Deep Dive Fix Deployment Not Found (404) in Azure OpenAI .NET