尝试在 Azure 数据工厂中复制数据时如何处理空的 Rest 调用?

How do you handle an empty Rest call when trying to copy data in azure data factory?

我有一个副本数据 activity,其中我的源数据集设置为 RestResource。它工作正常,除了每隔一段时间 Rest 调用 returns 一个空数据集:{"d":{"results":[]}}

这会导致以下错误

{
    "errorCode": "2200",
    "message": "ErrorCode=UserErrorTypeInSchemaTableNotSupported,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Failed to get the type from schema table. This could be caused by missing Sql Server System CLR Types.,Source=Microsoft.DataTransfer.ClientLibrary,''Type=System.InvalidCastException,Message=Unable to cast object of type 'System.DBNull' to type 'System.Type'.,Source=Microsoft.DataTransfer.ClientLibrary,'",
    "failureType": "UserError",
    "target": "Import Punch Adjustments",
    "details": []
}

我知道对于其他来源,您可能想要查找或检查元数据,然后执行条件判断,但我不确定如何为休息来源执行此操作。还有其他更好的选择吗?

您可以在失败时添加一个 activity,这样即使复制 activity 失败的管道也会 运行 成功。

示例:

我添加了一个 activity 来存储失败时的错误代码。

@string(activity('Copy data1').Error.errorCode)

管道状态: