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

Kishor Jayanna 25 Reputation points
2024-08-12T11:15:52.9466667+00:00

Hello,

I'm getting the error below in the web app. In that web app, I have deployed the Azure AI service chat.

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

Please help me with this error.

Thanks,

Kishor

Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
3,600 questions
{count} vote

1 answer

Sort by: Most helpful
  1. navba-MSFT 27,540 Reputation points Microsoft Employee Moderator
    2024-08-20T04:34:58.5933333+00:00

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

    .

    Please assign the RBAC role Cognitive Services Contributor to the user (Service principal) from Azure portal for your Azure Open AI resource. Then test this from your application and check if that helps.

    .

    Awaiting your reply.


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.