azure 数据工厂获取查找活动错误输出

tho*_*der 3 azure-data-factory azure-data-factory-2

我是我的管道,当查找失败时,只有一个查找活动和一个存储过程活动。

查找发送一个查询,如

    select 1/count(*) as result from sometable
Run Code Online (Sandbox Code Playgroud)

存储过程活动使用名为“error”的参数调用存储过程。

基本上,我希望在 count(*) 为 0 时此查找失败,然后我想从活动输出中捕获除以 0 的错误消息,并将其用作存储过程的输入参数。

当 count(*) 为 0 时查找的输出是:

    {
        "errorCode": "2100",
        "message": "Failure happened on 'Sink' side. ErrorCode=UserErrorFailedFileOperation,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Upload file failed at path 37b1ec96-be95-4010-8547-10387fc407a3\\result.,Source=Microsoft.DataTransfer.Common,''Type=System.Data.SqlClient.SqlException,Message=Divide by zero error encountered.,Source=.Net SqlClient Data Provider,SqlErrorNumber=8134,Class=16,ErrorCode=-2146232060,State=1,Errors=[{Class=16,Number=8134,State=1,Message=Divide by zero error encountered.,},],'",
        "failureType": "UserError",
        "target": "Lookup source count",
        "details": []
    }
Run Code Online (Sandbox Code Playgroud)

所以在存储过程活动中,我想把上面的消息放到存储过程的参数中。我已经尝试 @activity('Lookup source count').output.message 作为输入参数。但是得到这个错误:

    {
        "errorCode": "InvalidTemplate",
        "message": "The expression 'activity('Lookup source count').output.message' cannot be evaluated because property 'message' doesn't exist, available properties are ''.",
        "failureType": "UserError",
        "target": "log fail Lookup source count",
        "details": ""
    }
Run Code Online (Sandbox Code Playgroud)

我也尝试了许多其他选项,但没有一个有效。查找失败时如何从查找中获取错误消息?

Nic*_*aid 7

使用“添加动态内容”,将此用作您的 SP 参数值

@activity('<name of your lookup>').Error.Message

  • 这当然是表达式语法的指南,但没有关于如何捕获活动输出的线索。 (2认同)