How to move data from response of Http to a JSON file using Azure Data Factory

Anonymous
2022-01-10T22:58:24.07+00:00

I am trying to move data from Http Response (JSON format) --> a JSON file.
I am not moving data directly from REST API, but from Azure Function's Response (in JSON format).

Initially, I had three parts in this pipeline (built this pipe line based on this YouTube);
I was trying to mimic this pipeline by following each step on this video, but I am stuck how to move data from text (csv) file that has JSON data to SQL.

  1. Azure Function (to get Response of Http)
  2. Variable
  3. Copy data (text file --> text file)
    The output of 3rd step produced JSON data but in a text file, so I am not able to map data into my final destination, which is SQL table.
    163726-image.png

------------------------------------------------------------------------------------------------------

(1st step)
163735-image.png

(2nd step)
To explain how I built the last pipeline, regards to detail of 2nd step, Variable, I used "output.Response".
163742-image.png

(3rd step)
To explain how I built the last pipeline, regards to the 3rd step (move data from txt file to txt file), I used additional column like below.
163683-image.png

Now, I am trying to find a best way to move data from Response of Http --> JSON file --> (ultimately) SQL table.

How do I move data from Azure Function's Output.Response to a JSON file?

Thanks.

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

Accepted answer
  1. AnnuKumari-MSFT 33,986 Reputation points Microsoft Employee
    2022-01-11T19:57:38.5+00:00

    Hi @KingJava ,
    Thanks for posting your query on Microsoft Q&A platform.
    Glad that you found out the solution. As you mentioned, post copying the data into Delimited text file(csv format) , you need to add a copy activity with source as a file with JSON format pointing to the same Delimited text file(csv format) as is used in first copy activity in sink dataset. You can use auto create table and go with default mapping as well. Explicit mapping for JSON file to SQL table is not mandatory. You have already got the solution, still attaching the screenshot for additional help for the community.

    164005-image.png

    Hope this will help. Please let us know if any further queries.

    ------------------------------

    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you.
      Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
    • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators
    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Anonymous
    2022-01-11T18:33:17.247+00:00

    I was able to find the solution by having the data type of JSON on next "Copy data" pointing to the text file (csv) that I used. Even though the file was originally created with DelimitedText (csv) file, when I pointed that same file, but using JSON format, it took it. And rest (mapping to SQL table) is easy.

    0 comments No comments

  2. Dadheech, Raveesh 41 Reputation points
    2022-12-09T11:03:57.553+00:00

    Hey ,

    Can we post data from CSV(Json) file to rest api using data factory . If it is possible let me help to understand the approach .

    No solution being found on anywhere on internet , even we have seen option to use REST API as SINK in data factory pipeline .

    0 comments No comments

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.