How to trigger a Power Automate from API using Azure API Management?

Rizwan Aarif 0 Reputation points
2023-10-27T13:46:13.9333333+00:00

Hi There,

I want to trigger a Power Automate from API using Azure API Management, but I am getting the below error:

I have gone through many blogs and documentations online, but I am still getting the same error:

When I call another endpoint (non-Power automate) the works properly.

I can also call the power automate using Postman Rest client as well but from Azure APIM it's not getting triggered and returning the same. error.

One of the blogs which I followed is the below:
https://blog.sandro-pereira.com/2019/07/22/how-to-expose-microsoft-flow-thru-azure-api-management/

Please suggest where I am wrong.

Thanks in Advance.
Rizwan

{

    "error": {

        "code": "DirectApiAuthorizationRequired",

        "message": "The request must be authenticated only by Shared Access scheme."

    }

}
Not Monitored
Not Monitored
Tag not monitored by Microsoft.
37,797 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. navba-MSFT 20,810 Reputation points Microsoft Employee
    2023-10-30T06:26:27.25+00:00

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

    I understand that you want to trigger a Power Automate from API using Azure API Management, but you are getting below error message:

    "error": {
    
            "code": "DirectApiAuthorizationRequired",
    
            "message": "The request must be authenticated only by Shared Access scheme."
    
        }
    

    Please note that this error is specific to Power Automate. I would recommend posting this issue, in the Power Automate forum:

    Here is the link to the forum: https://powerusers.microsoft.com/t5/Forums/ct-p/FL_Comm_Forums

    One of the experts should be able to assist you better.

    Here are a few suggestions that might help resolve this issue:

    1. Set the trigger as “Anyone”: In Power Automate, you can set the first field “Who can trigger the flow” as “Anyone”. When you save the flow, it will provide a new URL that does not require authentication when used. If you copy the updated link and assign it to the button, it should work (not recommended)
    2. No Authentication: Try changing your Authentication Type to No Authentication under ‘2. Security’ and then try again.
    3. Similar issue is discussed here. Please check if that helps.

    Sharing some useful articles here, if that helps:

    • This tutorial talks about how you can publish and manage API in Azure APIM, export API as a custom connector for Power Apps and Power Automate.
    • Azure API Management connectors helps to quickly publish Azure API Management backed APIs to the Power Platform for easy discovery and consumption, dramatically reducing the time it takes to create apps connecting to Azure services. More Info here.
    • This article talks about Export APIs from Azure API Management to the Power Platform.

    Hope this helps.

    **
    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments