Request failed with status code 401 while accessing Question answering service in Azure Language studio

raj89 0 Reputation points
2023-09-04T14:45:40.4733333+00:00

Hey - We are using Azure bot framework in node js and using Language studio Question answer Rest API service. The api calls returns 401 when requested from the code but works just fine from postman calls. The botframework is deployed on Azure web app service. The other language studio service work fine. Please advise how to fix it.

I use the correct API URL and header with subscription key. It works perfect from postman.

https://chatbottest.cognitiveservices.azure.com/language/:query-text?api-version=2021-10-01

Access denied due to invalid subscription key or wrong API endpoint. Make sure to provide a valid key for an active subscription and use a correct regional API endpoint for your resource.

Azure AI Bot Service
Azure AI Bot Service
An Azure service that provides an integrated environment for bot development.
941 questions
Azure AI Language
Azure AI Language
An Azure service that provides natural language capabilities including sentiment analysis, entity extraction, and automated question answering.
519 questions
{count} votes

1 answer

Sort by: Most helpful
  1. VasaviLankipalle-MSFT 18,676 Reputation points Moderator
    2023-09-06T04:07:10.3966667+00:00

    Hello @raj89 , there could be several reaons causing this issue. I would suggest checking these things out: https://westus.dev.cognitive.microsoft.com/docs/services/5890b47c39e2bb17b84a55ff/operations/5890b47c39e2bb052c5b9c2f

    Response 401 You do not have access. Reasons can include:

    • used endpoint subscription key, instead of authoring key
    • invalid, malformed, or empty authoring key
    • authoring key doesn't match region
    • you are not the owner or collaborator
    • invalid order of API calls
    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.