ADF 获取响应标头

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

Azure 数据工厂中的 Web 活动返回如下部分的响应 enter image description here

我需要访问“Set-Cookie”值。 所以,我尝试这个

@activity('Set Cookie').output.ADFWebActivityResponseHeaders.Set-Cookie
)

enter image description here

错误显示为红色下划线,我不明白它是什么。 另外,在运行管道时,我收到错误

ErrorCode=InvalidTemplate, ErrorMessage=The expression 'activity('Set Cookie').output.ADFWebActivityResponseHeaders.Set-Cookie
)' is not valid: the string character 'C' at position '64' is not expected."

如果我这样做(在“Set-Cookie”之前停止,

@activity('Set Cookie').output.ADFWebActivityResponseHeaders
    )

我获得完整的 ADFWebActivityResonseHeaders 作为字符串。 如何深入到单个元素?

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

我已经使用示例密钥尝试了您的方案,但遇到了相同的错误。

enter image description here

上述情况发生在触发的管道运行时。这是由于键值中的特殊字符造成的。如果您尝试仅调试管道,它将给出错误的请求错误,并且在触发级别它将给出上述错误。

要解决上述错误并指定具有特殊字符的键的值,您可以将键括在

[]
中,如下所示
['<key_value>']

示例演示:

@activity('Web1').output.ADFWebActivityResponseHeaders['<key_name>']

enter image description here

结果:

enter image description here

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