简体   繁体   English

POST 数据到 REST API 使用 Azure 数据工厂

[英]POST data to REST API using Azure Data Factory

I am trying to setup Web activity to POST data from Azure Data Lake Gen 1 to REST API service, followed similar setup performed in this link but couldn't succeed due to error 'Missing file'. I am trying to setup Web activity to POST data from Azure Data Lake Gen 1 to REST API service, followed similar setup performed in this link but couldn't succeed due to error 'Missing file'.

Sample CURL request - Successful when attempted with POSTMAN示例 CURL 请求 - 尝试使用 POSTMAN 时成功

curl --location --request POST 'https://xxxx/files' \
--header 'X-API-TOKEN: xxxx' \
--form 'file=xxxxx'

Dataset settings:数据集设置: 在此处输入图像描述

Web activity settings: Web活动设置:

在此处输入图像描述

Run Error:运行错误: 在此处输入图像描述

Raised ticket on this to Microsoft and they stated this feature is yet to be implemented for Data Factory.向 Microsoft 提出了此问题,他们表示此功能尚未在 Data Factory 中实施。

But for now I have achieved this through Logic Apps.但现在我已经通过逻辑应用实现了这一点。

Logic Apps supports multiform data, where the data is read from Data lake and named as a file before sending it as attachment to target server.逻辑应用支持多格式数据,其中数据从数据湖中读取并命名为文件,然后将其作为附件发送到目标服务器。

在此处输入图像描述

{
  "$content-type": "multipart/form-data",
  "$multipart": [
    {
      "body": "@{body('Read_File_from_Data_Lake')}",
      "headers": {
        "Content-Disposition": "form-data; name=file; filename=Sample.csv"
      }
    }
  ]
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM