web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Calling a QnAMaker fro...
Power Automate
Answered

Calling a QnAMaker from PVA - unauthorised error

(0) ShareShare
ReportReport
Posted on by 1,304

Hi,

 

How are you? I hope this post finds you all well.

 

I have a azure resource and qnamaker.ai knowledge base that I am trying to pass back through power virtual agents for teams.

 

The flow looks like this:

 

1.PNG

 

But when I run the flow, I get the following error:

 

{
  "statusCode"401,
  "message""Unauthorized. Access token is missing, invalid, audience is incorrect (https://cognitiveservices.azure.com), or have expired."
}
 
I have added the API key to the connection prior to this step and that screenshot looks like this:
 
2.PNG
The API coming from the Cognitive Services part of Azure under keys and endpoints.
 
All the info from the generate answer action is coming from the qnamaker website:
 
3.png
 
Thanks in advance
Categories:
I have the same question (0)
  • JonDoesFlow Profile Picture
    1,304 on at

    I have a feeling the problem is I am not being shown the Endpoint key but the Ocp-Apim-Subscription-Key.

     

    Where do I find the endpoint key ?

     

    In this website

     

    There is this part, and the APIM key is not shown, the endpoint key is shown:

     

    4.PNG

  • Expiscornovus Profile Picture
    33,846 Most Valuable Professional on at

    Hi @Jondoesflow,

     

    Your setup looks ok. The EndPoint key can be found in the deployment details section of the website.

     

    deploymentdetailssection.png

     

     

     

    Just to double check. What is the location of your QnA service. Is it westus or something else?

     

    locationofcognitiveservices.png

     

    I believe the connector defaults to westus when you leave the site url empty:

    https://docs.microsoft.com/en-us/connectors/cognitiveservicesqnamaker/#creating-a-connection

     

  • JonDoesFlow Profile Picture
    1,304 on at

    Northeurope 

     

    do I need to change that ?

     

    where do I find the deployment details ?

     

    thank you !!!

  • Verified answer
    Expiscornovus Profile Picture
    33,846 Most Valuable Professional on at

    Hi @Jondoesflow,

     

    Yes, I would try and change it. To see if that makes a difference.

     

    Can you set the Site Url of the connection of your QnA maker action to this value: https://northeurope.api.cognitive.microsoft.com

     

    The deployment details can be found on the QnA Maker website.

     

    1. Go to https://www.qnamaker.ai/Home/MyServices

    2. Edit your target Kb, there should be a settings button in the right top corner

    3. On the settings it should be listed at the bottom of the page

  • JonDoesFlow Profile Picture
    1,304 on at

    Will try this all tomorrow thank you

  • leiwang Profile Picture
    6 on at

    Facing the same error with the new "custom question answering".

     

    Error Details: Unauthorized. Access token is missing, invalid, audience is incorrect (https://cognitiveservices.azure.com), or have expired.

     

  • Expiscornovus Profile Picture
    33,846 Most Valuable Professional on at

    Hi @leiwang,

     

    I believe @Jondoesflow had this issue because his QnAMaker was using the new Managed feature, correct? 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 997

#2
Valantis Profile Picture

Valantis 810

#3
Haque Profile Picture

Haque 642

Last 30 days Overall leaderboard