查找 AVRO 文件并将内容传递到 ADF 中的 Web 活动

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

我正在努力将 .AVRO 文件的特定内容正确传递到 Azure 数据工厂管道中的 Web 活动。

我有一个查找活动,用于查找 .AVRO 文件,然后使用设置变量活动存储该查找的输出值;

@activity('Lookup Avro File').output.value 

这个变量输出如下;

{
    "name": "variable1",
    "value": [
        {
            "Type": "Email",
            "Value": "[email protected]",
            "Timestamp": "2023-12-20 15:54:20.SSS",
            "IsAllowed": true
        }
    ]
}

我想将有价值的内容传递给网络活动,请求正文的格式如下;

{
   "Key":"MarketingPreferences",
   "Value":[
      {
         "Type":"Email",
         "Value":"[email protected]",
         "Timestamp":"2023-12-20 15:54:20.SSS",
         "IsAllowed":true
      }
   ]
}

我怎样才能在网络活动中实现这一点,这是我在正文中尝试过的:

{
    "Key": "MarketingPreferences",
    "Value": @{variables('variable1')}
}
azure-data-factory avro
1个回答
0
投票

您尝试过的上述表达式将按预期工作。

enter image description here

如果您看到正文的输入,它将以字符串形式显示表达式的结果。

enter image description here

但是你需要检查你的目标。在这里,作为示例,我已使用 Web 活动将上述数据发送到 blob JSON 文件,您可以看到它使用相同的正文表达式成功上传。

enter image description here

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