Azure Cognitive Service Custom Question Answering Keeps Returning a 404 on "Get Answers" and "Get Answers From Text"

Kyle Hoffman 1 Reputation point
2022-07-19T13:57:01.5+00:00

The cognitive services API is always returning error: {code: "404", message: "Resource not found"} when I try to hit the endpoints for "Get Answers" and "Get Answers from Text" in Postman.
Another endpoint called "Get Qnas" uses all the same environment variables and returns all the question and answer pairs so I'm completely stumped on why the other two endpoints are failing. Any help would be greatly appreciated.

This is the CURL request for "Get Answers":

curl -X POST "https://centralus.api.cognitive.microsoft.com/language/:query-knowledgebases?projectName=POCAzureCognitiveServices&api-version=2021-10-01&deploymentName=production" -H "Ocp-Apim-Subscription-Key: XYZ" -H "Content-Type: application/json" -d "{\"top\":3,\"question\":\"Test Question\",\"includeUnstructuredSources\":true,\"confidenceScoreThreshold\":\"0\",\"answerSpanRequest\":{\"enable\":true,\"topAnswersWithSpan\":1,\"confidenceScoreThreshold\":\"0\"},\"filters\":{\"metadataFilter\":{\"logicalOperation\":\"AND\",\"metadata\":[{\"key\":\"category\",\"value\":\"api\"}]}}}"

This is the postman collection: https://www.getpostman.com/collections/df889f4816f4b2ea7df4

These are the environment variables: 222239-image.png

Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
2,194 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. YutongTie-MSFT 43,076 Reputation points
    2022-07-19T19:10:31.313+00:00

    Hello @Kyle Hoffman

    I think you are using old QnA maker resource or Cognitive Service resource to call question answering API, is that correct? For question answering API, you need to create a language service and use the key of it.

    If you have one langague service key, please use it, if you are currently still working on QnA maker/ Cognitive Service, please see below notice and follow the migration guidance.

    The QnA Maker service is being retired on the 31st of March, 2025. A newer version of the question and answering capability is now available as part of Azure Cognitive Service for Language. For question answering capabilities within the Language Service, see question answering. Starting 1st October, 2022 you won’t be able to create new QnA Maker resources.

    For information on migrating existing QnA Maker knowledge bases to question answering, consult the migration guide - https://learn.microsoft.com/en-us/azure/cognitive-services/language-service/question-answering/how-to/migrate-qnamaker

    I hope this helps, please let me know if you are not the case or you need more help, we are glad to check.

    Regards,
    Yutong

    -Please kindly accept the answer if you feel helpful to support the community, thanks a lot.

    0 comments No comments