简体   繁体   English

从 Azure Function App 监控长时间运行的 Power Automate Cloud Flow

[英]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:我的设置:

  1. I have Azure Function App With Durable Function that executes System.Net.Http.HttpClient.PostAsync我有 Azure Function App With Durable Function 执行 System.Net.Http.HttpClient.PostAsync
  2. I have a Power Automate Cloud Flow which is triggered by a HTTP call and has a 2 minute delay inside我有一个 Power Automate Cloud Flow,它由 HTTP 调用触发,内部有 2 分钟的延迟

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.

相关问题 从 YAML 执行电源自动化流程 - Executing a power automate flow from YAML 将文件从 Power Automate 流上传到 GCS 存储桶 - Upload a file from a Power Automate flow into a GCS bucket 触发 Azure AD 保护 API 托管在 Azure Web 来自 Power Automate 的应用程序 - Trigger Azure AD Protected API hosted in Azure Web Apps from Power Automate Azure Function 长期和应用服务计划,持久 function - Azure Function long duration and App Service Plan, Durable function 从 Cloud 触发数据流作业时 dill 出错 Function - Error with dill when triggering a Data Flow job from Cloud Function Firebase 云 Function 适用于 Postman 但不适用于 App - Firebase Cloud Function Works With Postman But Not From App Azure 应用服务-文件完整性监控(FIM) - Azure App Service - File Integrity Monitoring (FIM) 云 function 从特定应用程序发送 FCM - cloud function to send FCM from specific app 您可以从 Cloud Function 内部调用 Cloud Run 应用程序吗? - Can you call a Cloud Run app from inside a Cloud Function? Azure function 不并行运行 - Azure function not running parallel
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM