Data Factory : How can i update multiple Json files with row wise data stored in a separate csv file.

Ashwini Prakash 1 Reputation point
2021-10-22T04:56:24.73+00:00

I am working on building a pipeline, which should update the existing set of JSON files at the blob store with key/values stored in a CSV file.

> Blob store structure : 

> 

> Asset_1 --> data.json

> Asset_2 --> data.json

> Asset_x --> data.json

And CSV files has values like :

Header:Asset , views , downloads
Asset_1,20,30
Asset_2,30,2
Asset_x,10,20

How can I update each JSON file ( Array of objects type ) with corresponding values for each Assets?

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

1 answer

Sort by: Most helpful
  1. ShaikMaheer-MSFT 38,546 Reputation points Microsoft Employee Moderator
    2021-10-25T10:46:21.873+00:00

    Hi @Ashwini Prakash ,

    Thank you for posting query in Microsoft Q&A Platform.

    Sorry your ask was little unclear to me. You mean, you want to take data from csv file and added that data inside some existing json file? Feel free to correct me if my understanding is wrong. Sample desired output json may help.

    If my understanding is correct then Please note, Files in storages will always gets override. Hence using copy activity its not possible.

    You should consider using data flows for this purpose.

    High level details of data flow implementaion:
    Step1: Add your json file as source.
    Step2: Add your csv file as another source.
    Step3: Try to added some surrogate key on both source so that we can perform join between json and csv file to merge columns from both.
    Step4: Perform Join on both sources.
    Step5: Load final loaded data in to json file.

    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

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.