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

问题描述 投票:0回答:1

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

查找发送了类似]的查询>

    select 1/count(*) as result from sometable

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

基本上,我希望在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": []
    }

因此,在存储过程活动中,我想将消息从上方放置到存储过程的参数中。我已经为输入参数尝试了@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": ""
    }

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

在我的管道中,当查找失败时,只有一个查找活动和一个存储过程活动。查找会发送查询,例如select 1 / count(*)作为来自某个表的结果...

azure-data-factory azure-data-factory-2
1个回答
0
投票

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

© www.soinside.com 2019 - 2024. All rights reserved.