azure - 如何执行 Azure 数据工厂管道 X 次(对于 X 个不同的参数值)?
问题描述
我有一个每天在特定时间触发的管道,效果很好。该管道获取当前日期作为输入参数,这也很好。
现在我正在做同一管道的替代版本来模拟过去的日期,其中参数是日期值(例如 2018 年 5 月 23 日的“2018-05-23”)。但是,如果我想在 2018 年全年运行管道(所以我需要 365 个不同的参数),我该怎么做?
当然,我可以在 1 月 1 日手动触发它,然后是 1 月 2 日,依此类推,但这需要很长时间。我想触发 1 月 1 日,然后在 1 月 1 日结束后依次在一年中的其他 364 天执行管道。
提前致谢!
解决方案
So... to loop through a series of dates, I'd suggest populating an input parameter with an array of date values (you can generate this in a straightforward way through code, and pass this as a parameter to your pipeline).
Then, in your pipeline, you can define a ForEach loop, iterating through each of the date entries in your parameter, executing the pipeline for each date.
Based on your requirement to run the pipelines in sequence, without parallelism, just be sure to set isSequential
to true
in your pipeline's ForEach
definition. Something like this, as a simple example:
{
"name":"...",
"type":"ForEach",
"typeProperties":{
"isSequential":"true",
"items": {
"value": "@pipeline().parameters.datesToProcess",
"type": "Expression"
},
"activities":[
{
...
}
]
}
}
You can read more about ForEach
in this article.
推荐阅读
- javascript - 滚动导航栏时更改活动列表
- python - 如何仅使用递归将列表转换为python中的数字
- flutter - 消息颤动中的自定义容器边框
- docker - 如何在 AWS ECS 上的 Dockerfile 中设置健康检查
- vega-lite - 在灰色背景的 vega-lite 中绘制小倍数
- raku - 作为对象的 Cro 模板
- node.js - 一个请求有多少个数据库操作是正常的?
- c# - 奇怪的错误:Microsoft (R) Visual C# 编译器版本 3.5.0-dev-20359-01 (8da8ba0c)
- java - 无法修复错误:0909006C:PEM 例程:get_name:tomcat 服务器没有起始行
- ios - 文档 x 的文件已被另一个应用程序修改。Xcode 中也有未保存的更改