question

AnkitKumar-6861 avatar image
0 Votes"
AnkitKumar-6861 asked ShaikMaheer-MSFT commented

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

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
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @AnkitKumar-6861 ,

Following up to check is below provided answer by @HimanshuSinha-MSFT helped? If Yes, Please Accept Answer. Feel free to let us know if any further queries. Thank you.

0 Votes 0 ·

Hi @AnkitKumar-6861 ,

Just checking is below provided answer by @HimanshuSinha-MSFT helped? If Yes, Please Accept Answer. Feel free to let us know if any further queries. Thank you.

0 Votes 0 ·

1 Answer

HimanshuSinha-MSFT avatar image
0 Votes"
HimanshuSinha-MSFT answered

Hello @AnkitKumar-6861 ,
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://docs.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



image.png (40.3 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.