Description
Library name and version
Azure.AI.OpenAI - 2.1.0
Describe the bug
I've had the following code running in production since mid 2024:
options.AddDataSource(new AzureSearchChatDataSource()
{
Endpoint = new Uri(searchEndpoint),
IndexName = targetIndexName
Authentication = DataSourceAuthentication.FromApiKey(searchApiKey)
}
And we just started noticing on Monday (3/10/2025) that when we call out for a chat completion via:
client.CompleteChatStreamingAsync(messages, options, cancellationToken)
The system immediately throws an HTTP 400 Bad Request error. Nothing has changed with regards to our AI Search service setup or configuration.
I've also attempted to upgrade to the 2.2.0-beta.2 version of the library but that did not fix the issue. We are targeting the GPT-4o model in our Azure tenant.
Expected behavior
The chat completion would utilize the Azure AI Search endpoint for RAG functionality within our LLM chat application, and return a response with relevant citations.
Actual behavior
Service request failed.
Status: 400 (Bad Request)
Reproduction Steps
var options = new ChatCompletionOptions();
options.AddDataSource(new AzureSearchChatDataSource()
{
Endpoint = new Uri(searchEndpoint),
IndexName = targetIndexName
Authentication = DataSourceAuthentication.FromApiKey(searchApiKey)
}
await foreach (var completion in client.CompleteChatStreamingAsync(messages, options, cancellationToken))
{
// handle content updates...
}
Environment
Visual Studio 2022 Enterprise
.NET SDK:
Version: 9.0.103
Commit: 96da45d427
Workload version: 9.0.100-manifests.ea610b94
MSBuild version: 17.12.24+90b52dda6
Runtime Environment:
OS Name: Windows
OS Version: 10.0.26100
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\9.0.103\
Activity