1
votes

I want to copy items from

CosmosDB databaseA/productCollection

to

CosmosDB databaseB/productCollection

Therefore I decided to use Azure Data Factory. I actived also "Export as-is to JSON files or Cosmos DB collection".

The read operation works as expected.
Unfortunately, the write operation stops because of an error related to the data:

ErrorCode=InvalidTemplate, ErrorMessage=Unable to parse expression 'Currency'

{
"ProductName": "Sample",
"Price": {
    "@Currency": "GBP",
    "$": "2624.83"
}

}

I'm not able to change to input data itself. The output data has to equal the input data.

Is there possiblity, that @Currency will not be interpreted as an expression

In ARM, this part is failling:

Price.{@Currency}

1

1 Answers

0
votes

I tried to reproduce your issue but it works for me. I used copy activity to transfer data from account A to account B.

enter image description here

enter image description here

Additional, if this operation is just need to be executed once, please consider using Azure Cosmos DB Migration Tool. It's free for usage. You could export the data from cosmos db A as json file then import it into cosmos db B very simply.Also, it could be executed in the cmd so that it could be made as a scheduled job on the windows system.