[英]Monitoring long running Power Automate Cloud Flow from Azure Function App
I need to be able to execute a long running Power Automate Cloud Flow (say 2 hours) from Azure Function App(using Visual Studio for development).我需要能够从 Azure Function 应用程序(使用 Visual Studio 进行开发)执行长时间运行的 Power Automate Cloud Flow(比如 2 小时)。
My set up:我的设置:
Issue: Naturally it times out.问题:自然超时。
What I tried: I tried overriding System.Net.Http.HttpClient.SendAsync and timeout policies to make the timeout indefinite, but that doesn't work, not that it would work given 2hr run times.我尝试了什么:我尝试覆盖 System.Net.Http.HttpClient.SendAsync 和超时策略以使超时无限期,但这不起作用,而不是在给定 2 小时运行时间的情况下它会起作用。
My best case scenario: What I really want is an ability to send a request to start execution of the Power Automate Cloud Flow kind of like a job, and then have ability to monitor execution by going some kind of monitoring place.我的最佳案例场景:我真正想要的是能够发送请求以开始执行 Power Automate Cloud Flow,就像工作一样,然后能够通过前往某种监视位置来监视执行。 I am pretty positive that's what power automate does internally, but how would I do it from Azure Function App?我非常肯定这就是 power automate 内部所做的,但我如何从 Azure Function 应用程序中做到这一点? For the life of me I cannot find an answer to this:)对于我的一生,我找不到答案:)
So I figured it out, figured I should post the answer.所以我想通了,想我应该发布答案。 I forgot that when you want to use asynchronous pattern you have to enable Async Response in your flow.我忘记了当你想使用异步模式时你必须在你的流程中启用异步响应。 So any response in the flow should be set to Async in the settings.因此,流程中的任何响应都应在设置中设置为异步。
This action will enable Asynchronous pattern for the flow, and HTTP calling it, will reply right away with status 202, and info about the URL to go for checking the status in the headers.此操作将为流启用异步模式,调用它的 HTTP 将立即回复状态 202,以及有关 URL 到 go 的信息以检查标头中的状态。
So it was much simpler than one would imagine:)所以它比人们想象的要简单得多:)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.