python calls openAI and reports an error openai.PermissionDeniedError: Error code: 403

Edward H T WANG_SP 0 Reputation points
2024-04-23T15:46:25.6233333+00:00

Calling client.chat.completions.create reports an error openai.PermissionDeniedError: Error code: 403 - {'error': {'code': 'AuthenticationTypeDisabled', 'message': 'Key-based authentication is disabled for this resource. '}}

Azure AI Search
Azure AI Search
An Azure search service with built-in artificial intelligence capabilities that enrich information to help identify and explore relevant content at scale.
721 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Dillon Silzer 54,646 Reputation points
    2024-04-23T16:33:58.6266667+00:00

    Hi Edward,

    Check that the API Key Authentication for the resource is not disabled:

    Disable API key authentication

    https://learn.microsoft.com/en-us/azure/search/search-security-rbac?tabs=config-svc-portal%2Croles-portal%2Ctest-portal%2Ccustom-role-portal%2Cdisable-keys-portal#disable-api-key-authentication

    Connect to Azure AI Search using key authentication

    https://learn.microsoft.com/en-us/azure/search/search-security-api-keys?tabs=rest-use%2Cportal-find%2Cportal-query

    If this is helpful please accept answer.

    0 comments No comments