英文:
How to cancel long running ADF pipelines using the logic app
问题
我有一个逻辑应用查询,用于获取长时间运行的流水线的详细信息,并通过电子邮件发送流水线名称。现在我想取消那些长时间运行的流水线,我该如何在逻辑应用中实现?
英文:
I have a logic app query to get the details of long running pipelines and I sending the email with the pipeline names. Now I want to cancel those pipelines which are running for long time how Can I implement with Logic app ?
答案1
得分: 1
-
在逻辑应用中,“Azure数据工厂”连接器中直接提供了一个操作。以下是一个示例,您可以取消流水线运行。
-
我正在使用的逻辑应用的流程如下:
- 如下图所示,取消了流水线运行:
- 并且将触发一封邮件,如下图所示:
- 如果要动态获取流水线运行,可以使用此Microsoft文档中指定的REST API。
- 您可以遍历此列表,检查状态为“InProgress”的项,并获取当前运行时间以检查是否足够长以进行取消。
英文:
-
There is an action available directly in logic apps "Azure data factory" connector. The following is an example where you can cancel a pipeline run.
-
The following is the flow of the logic app that I am using:
- The pipeline run is cancelled as shown in the below image:
- And a mail will be triggered as shown in the below image:
- If you want to get the pipeline runs dynamically, you can use the rest API specified in this Microsoft documentation.
- You can loop through this list and check for whose status is "InProgress" and get the current running time to check if its long enough to cancel.
答案2
得分: 1
If the intend is to cancel a long running ADF pipeline, you can do that from ADF only (using a different pipeline) - using web activity. 获取正在运行的管道(Saideep 在他的回应中提到了这一点)
-
使用 durationInMs 属性来获取“运行时间多长”
-
使用 runid 来取消运行:https://learn.microsoft.com/en-us/rest/api/datafactory/pipeline-runs/cancel?tabs=HTTP
英文:
If the intend is to cancel a long running ADF pipeline , you can do that from ADF only ( using a different pipeline)
-
using web activity. Get the running pipeline ( Saideep has mentioned this in his response )
-
Use the durationInMs property to get "for how long is this running "
-
Use the runid to cancel the run : https://learn.microsoft.com/en-us/rest/api/datafactory/pipeline-runs/cancel?tabs=HTTP
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论