How to fix the error <class 'openai.AuthenticationError'>

DAA 20 Reputation points
2024-03-08T15:57:30.4833333+00:00

I have installed and deployed the sample app described in this link:

https://github.com/Azure-Samples/azure-search-openai-demo/blob/main/README.md#deploying-from-scratch

I have followed the guidelines for minimal cost deployment:

https://github.com/Azure-Samples/azure-search-openai-demo/blob/main/README.md#deploying-from-scratch

However, when I try to use the app through the browser, I get this error:

Error: The app encountered an error processing your request. If you are an administrator of the app, view the full error in the logs. See aka.ms/appservice-logs for more information. Error type: <class 'openai.AuthenticationError'>

Any help would be greatly appreciated.

Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
2,645 questions
{count} votes

Accepted answer
  1. navba-MSFT 20,810 Reputation points Microsoft Employee
    2024-03-21T09:36:58.7466667+00:00

    @DAA I'm glad to see you were able to resolve your issue. Thanks for posting your solution so that others experiencing the same thing can easily reference this. Since the Microsoft Q&A community has a policy that the question author cannot accept their own answer, they can only accept answers by others, I'll repost your solution in case you'd like to Accept the answer.

    Issue:

    You have deployed the sample webapp and encountering the error openai.AuthenticationError. Resolution:

    You had to raise the request for Azure OpenAI. Then you followed the below 2 plans and that resolved the issue:

    1. Looking at the error, it seems like the Azure OpenAI connection is mis-configured. You can also open App Service in the Azure Portal and check the environment variables in the configuration to see it is set correctly.
    2. If your app does not have authentication configured. Please add an identity provider by finding your app in the Azure Portal and following these instructions User's image
    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful