Power Apps 中的 Azure APIM 自定义连接器 returns 空主体响应

Azure APIM custom connector returns empty body response in Power Apps

我正在通过向导在 Power Apps 中创建自定义连接器,以在 Azure APIM 中调用简单的 Get 操作。我可以使用 Postman、Fiddler 和 CURL 调用 API。但是,当我尝试使用测试选项卡测试连接器时,我得到 200 OK 但响应正文为空:

值得一提的是,这个响应主体为空的问题仅在 Azure APIM 中发生 APIs。如果我访问后端 API,托管在 Azure App Service 中,而不通过 Azure APIM,我会收到一个响应正文。我已经在互联网上与其他 public API 进行了测试,效果也很好。空响应的问题似乎与 Power Apps 和 Azure 之间的集成有关 APIM.

非常感谢任何帮助。

借助 Azure Application Insights 日志,我发现这与 CORS 有关。为解决此问题,我将 https://flow.microsoft.com 添加到 Azure APIM CORS 策略以允许来自 PowerApps 测试控制台的调用通过,如下所示: