Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] 401 Unauthorized with Azure OpenAI CompleteChatAsync() #45932

Open
markjbrown opened this issue Sep 12, 2024 · 1 comment
Open

[BUG] 401 Unauthorized with Azure OpenAI CompleteChatAsync() #45932

markjbrown opened this issue Sep 12, 2024 · 1 comment
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team OpenAI question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.

Comments

@markjbrown
Copy link

Library name and version

Azure.AI.OpenAI 2.0.0-beta.2

Describe the bug

I am getting a consistent 401 unauthorized when using Default Identity using the new Azure OpenAI version for CompleteChatAsync().

It works fine when using embeddings. It's just Chat that doesn't work. I double checked by running the same test on a v1 beta package and it works fine. I am migrating my app to this new version when I encountered this.

Expected behavior

Function call should successfully authenticate and complete the request.

Actual behavior

The app itself appears to just sit there waiting. Eventually this comes into the log window.

  System.ClientModel.ClientResultException: Service request failed.
  Status: 401 (Unauthorized)
  
     at Azure.AI.OpenAI.ClientPipelineExtensions.ProcessMessageAsync(ClientPipeline pipeline, PipelineMessage message, RequestOptions options)
     at Azure.AI.OpenAI.Chat.AzureChatClient.CompleteChatAsync(BinaryContent content, RequestOptions options)
     at OpenAI.Chat.ChatClient.CompleteChatAsync(IEnumerable`1 messages, ChatCompletionOptions options, CancellationToken cancellationToken)

Reproduction Steps

This is difficult to build a complete repro for. The code for this is in this branch, https://github.com/markjbrown/cosmosdb-nosql-copilot/tree/oai2-sk118rc The file is /src/services/OpenAiService.cs the function is GetRagCompletionAsync()

Environment

Win 11
.NET 8
VS 17.11.3

@github-actions github-actions bot added Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team OpenAI question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team. labels Sep 12, 2024
Copy link

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @jpalvarezl @ralph-msft @trrwilson.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team OpenAI question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

1 participant