【问题标题】:skip failed activity in azure data factory and proceed to next activity跳过 azure 数据工厂中失败的活动并继续下一个活动
【发布时间】:2021-03-15 17:04:32
【问题描述】:

我们有一个要求,如果管道中的任何活动失败,那么它不应该妨碍其余的活动,并且应该继续进行其余的活动

{
    "name": "pipeline1",
    "properties": {
        "description": "pipeline1",
        "activities": [
            {
                "name": "PipelineName Lookup",
                "type": "Lookup",
                "dependsOn": [],
                "policy": {
                    "timeout": "7.00:00:00",
                    "retry": 0,
                    "retryIntervalInSeconds": 30,
                    "secureOutput": false,
                    "secureInput": false
                },
                "userProperties": [],
                "typeProperties": {
                    "source": {
                        "type": "AzureSqlSource",
                        "sqlReaderQuery": {
                            "value": "select cast(1 as bit)",
                            "type": "Expression"
                        },
                        "queryTimeout": "02:00:00",
                        "partitionOption": "None"
                    },
                    "dataset": {
                        "referenceName": "AzureSqlTable1",
                        "type": "DatasetReference"
                    }
                }
            },
            {
                "name": "If Condition1",
                "type": "IfCondition",
                "dependsOn": [
                    {
                        "activity": "PipelineName Lookup",
                        "dependencyConditions": [
                            "Completed"
                        ]
                    }
                ],
                "userProperties": [],
                "typeProperties": {
                    "expression": {
                        "value": "@equals(activity('PipelineName Lookup').output,True)",
                        "type": "Expression"
                    },
                    "ifFalseActivities": [
                        {
                            "name": "Lookup1_copy1",
                            "type": "Lookup",
                            "dependsOn": [],
                            "policy": {
                                "timeout": "7.00:00:00",
                                "retry": 0,
                                "retryIntervalInSeconds": 30,
                                "secureOutput": false,
                                "secureInput": false
                            },
                            "userProperties": [],
                            "typeProperties": {
                                "source": {
                                    "type": "AzureSqlSource",
                                    "sqlReaderQuery": "Select 1",
                                    "queryTimeout": "02:00:00",
                                    "partitionOption": "None"
                                },
                                "dataset": {
                                    "referenceName": "AzureSqlTable3",
                                    "type": "DatasetReference"
                                }
                            }
                        }
                    ],
                    "ifTrueActivities": [
                        {
                            "name": "Lookup1",
                            "type": "Lookup",
                            "dependsOn": [],
                            "policy": {
                                "timeout": "7.00:00:00",
                                "retry": 0,
                                "retryIntervalInSeconds": 30,
                                "secureOutput": false,
                                "secureInput": false
                            },
                            "userProperties": [],
                            "typeProperties": {
                                "source": {
                                    "type": "AzureSqlSource",
                                    "sqlReaderQuery": "Select 1",
                                    "queryTimeout": "02:00:00",
                                    "partitionOption": "None"
                                },
                                "dataset": {
                                    "referenceName": "AzureSqlTable3",
                                    "type": "DatasetReference"
                                }
                            }
                        }
                    ]
                }
            }
        ],
        "annotations": []
    }
}

我正在使用上面的代码,但我认为这不符合我的要求。我们实际上正在寻找的是一种设计,如果任何活动失败,那么它应该跳过失败的活动并继续进行剩余的活动。我会请求一些帮助

【问题讨论】:

    标签: azure azure-data-factory azure-data-factory-2


    【解决方案1】:

    使依赖项“完成”而不是“成功”...单击圆圈中的加号以获取下拉菜单,如下所示...

    ...然后链接到您的下一个活动

    链接活动的箭头不是一个流,它们显示了依赖关系......所以这里的查找只依赖于复制完成(成功或失败),而不是它必须成功(默认)。

    希望这是有道理的!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-09-02
      • 2020-06-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多