Share via

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

Orlando Herrera 10 Reputation points
Aug 27, 2024, 8:51 PM

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.
3,894 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,598 questions
Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
1,124 questions
{count} votes

1 answer

Sort by: Most helpful
  1. navba-MSFT 27,500 Reputation points Microsoft Employee
    Aug 28, 2024, 2:54 AM

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