Skip to content

[BUG] Azure OpenAI Chat Completions - OnYourData throwing Bad Request #48749

Open
@mikepugh

Description

@mikepugh

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)

Image

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ClientThis issue points to a problem in the data-plane of the library.OpenAIService AttentionWorkflow: This issue is responsible by Azure service team.customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions