AuthenticationError: Error code: 401 - {'error': {'code': 'PermissionDenied', 'message': 'Principal does not have access to API/Operation.'}}

Orlando Herrera 10 Reputation points
2024-08-27T20:51:30.2033333+00:00

Deployed a model and in the chat playground is working ok, but when deployed into the webapp it gives me this error: AuthenticationError: Error code: 401 - {'error': {'code': 'PermissionDenied', 'message': 'Principal does not have access to API/Operation.'}} Any guidance will be a great help

Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
2,920 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,663 questions
Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
902 questions
{count} votes

1 answer

Sort by: Most helpful
  1. navba-MSFT 23,625 Reputation points Microsoft Employee
    2024-08-28T02:54:39.55+00:00

    @Orlando Herrera Welcome to Microsoft Q&A Forum, Thank you for posting your query here!

    .

    Please follow the below action plans:

    • assign the RBAC role Cognitive Services Contributor and Cognitive Services OpenAI User to the user (Service principal) from Azure portal for your Azure Open AI resource.
    • Enable the managed identity for your webapp and then give the same above RBAC permission on Azure OpenAI resource.
    • Then test this from your application and check if that helps.

    .

    Awaiting your reply.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.