Azure Data Factory Web Post output to CSV

Dondapati, Navin 291 Reputation points
2020-07-21T16:49:54.177+00:00

Hi Guys,

We have web Activity uses url and post method , with multiple select statement, we want output of post activity to be loaded to csv file, is it possible with ADF?

Rest Connection and Blob connection are sucessful.

we used copy activity rest-->blob; got below error
{
"errorCode": "2200",
"message": "Failure happened on 'Source' side. ErrorCode=UserErrorHttpStatusCodeIndicatingFailure,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=The HttpStatusCode 415 indicates failure. ,Source=Microsoft.DataTransfer.ClientLibrary,'",
"failureType": "UserError",
"target": "Copy data1",
"details": []
}

Regards,
Navin

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,623 questions
0 comments No comments
{count} votes

Accepted answer
  1. MartinJaffer-MSFT 26,236 Reputation points
    2020-07-23T23:00:15.177+00:00

    I have made a solution, by taking the JSON you provided, and uploading to a public blob container.
    Also uploaded, a csv / txt file whose contents are a newline.

    13543-additonalcolumns.jpg

    Here I take advantage of the "Additional Columns" feature of the Copy Activity. The additional columns appends values to the end of each row read from the source. Since I need a row to append to, I uploaded a file, empty except for a newline. This I use for my source. If you want to include headers, a second row is needed.

    For the sink I also used a blob, writing to csv. The output looks like

       Prop_0,Code,Qualifier  
       ,"686","AMA"  
    

1 additional answer

Sort by: Most helpful
  1. MartinJaffer-MSFT 26,236 Reputation points
    2020-07-21T19:27:10.303+00:00

    Hello @Anonymous and thank you for your question.

    If I understand your situation correctly, you want to pull data from an URL and write it to csv.
    First you tried with the REST connector in Copy activity , but got the error with HttpStatusCode 415. The "test connection" button worked for both. What happened when you tried "preview data"?

    Then you tried using a Web activity, and were able to successfully read the data, no errors, but do not know how to write it.

    The HttpStatusCode 415 is "Unsupported Media Type". This means the server does not accept the requested format of data. I.E. you tell the server "Give me the results in AVRO format" but the server says "No, I only do CSV and text, not AVRO".

    I do not know what format the data you retrieve is. The REST connector only supports JSON. This could be the reason.
    I would like you to try the HTTP connector instead. The HTTP connector supports many data formats. I think this should help.

    Using the HTTP connector will be easier than trying to write the output of a Web activity. If the HTTP connector does not work, let me know and I will try to help with the Web activity.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.