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

DAA 20 Reputation points

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

I have followed the guidelines for minimal cost deployment:

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 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,144 questions
{count} votes

Accepted answer
  1. navba-MSFT 16,940 Reputation points Microsoft Employee

    @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.


    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