Share via

Using DataFactory to copy documents from one container to another and adding a partition key value in the document

Ankit Kumar 91 Reputation points
2021-07-15T06:53:00.993+00:00

My job is to move data from my container in CosmosDb to another container in same database. In my new container I have defined my partition key as /PKey but the documents to be moved does not have a key named as "PKey". I would like to create this key while moving the document to new container and this PKey will contain value by concanateing few of my key values in the document(for e.g. PKey:"will be combination of Id and name key in the document").

So if my Source document is : {Name: "ZZZ", ID: 21} My target will be {Name: "ZZZ", ID: 21, PKey: "ZZZ21"}

I would like to know if this possible in Data factory which I have selected for this copy activity , i.e. if I can create a Key on the fly while moving documents.Thanks

Azure Data Factory
Azure Data Factory

An Azure service for ingesting, preparing, and transforming data at scale.


Answer accepted by question author

HimanshuSinha 19,637 Reputation points Microsoft Employee Moderator
2021-07-16T20:08:40.837+00:00

Hello @Ankit Kumar ,
Thanks for the ask and using the Microsoft Q&A platform .
At this time the copy activity does not support this scenario . It does support adding an additional column but it will not help in this scenario .

115532-image.png

https://learn.microsoft.com/en-us/azure/data-factory/copy-activity-overview#add-additional-columns-during-copy

May I request you to please log the same here . Product group does monitor the request and they can plan for the implementation in future .Once you log the feature request you will also be notified on the status of the request . We expect you to keep using this forum and motivate others to do the same . You can always help other community members by answering to their queries .

Please do let me know how it goes .
Thanks
Himanshu
Please do consider clicking on "Accept Answer" and "Up-vote" on the post that helps you, as it can be beneficial to other community members

Was this answer helpful?

0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

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