I have an AAD-protected API exposed through API Management. I am able to access the API directly with a custom connector, but not when the API is placed behind API Management. (API Management does not use OAuth itself, it only contains some inbound token validation.)
Running a test on the custom connector does not give any information about the underlying problem, because the connector returns HTTP 200, no error, but with no data. Since the API does return data, behind the HTTP 200 there must be some error. The only thing I change in the connector between the two scenarios is the API vs API Management hostname.
With a local client I can access both the API and API Management successfully (using just the API in production is in this case not an option).
How to troubleshoot this given the absence of any error message?
Solved! Go to Solution.
Hi @maimon ,
Based on the issue that you mentioned, I think the Azure API Management policy in custom connector in PowerApps could achieve your needs.
please check the following article for more details:
More details about Policy template supported in PowerApps custom connector, please refer to the following article:
According to the scenario that you mentioned, I think you could consider configure a Route Request template policy within you custom connector. When you call the action path under your API Management, it would be routed to access underlying API to obtain data.
Hi @maimon ,
Do you create a custom connector based on your Azure API Management directly?
If you created a custom connector based on your Azure API Management directly, I afraid that there is no way to achieve your needs. The Azure API Management policy in customer connector is used to transform and protect your underlying REST API. You could not use the Azure API Management policy in customer connector within PowerApps to apply changes to the Azure API Management.
So please consider create a custom connector based on your underlying REST API, and then use the Azure API Management policy to transfer and protect your underlying REST API.
Please check and see the following article about Azure API Management:
thanks. We found that API Management won't forward the call to the backend because of the CORS policies:
fixes the problem. It is not clear, however, why a call from Power Apps is blocked by a CORS policy and which hosts should be allowed for Power Apps.
Hi @maimon ,
Based on the issue that you mentioned, I think this issue is related to your Azure Function rather than PowerApps Itself.
On your side, you should configure proper CORS policy for your Azure function. More details about configuring a CORS policy for Azure function, please check the following article:
More details about hosted allowed for PowerApps, please check the following article:
Check out the News & Announcements to learn more.
Did you know that you can visit the Power Query Forum in Power BI and now Power Apps
Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.
Check out our new Discover Your Career Path blog post series and get all the details.