Hello @Brady Chambers,
As per this MS Documentation,
Currently, The Azure Cosmos DB serverless is not supported in mapping data flow.
As you are using the Serverless Cosmos DB, this might be the reason for the above behavior.
You can try the below possible workarounds to achieve your requirement.
When looking at your last column output data, you are getting the JSON string as output. So, there are two Scenarios that you can consider here.
- Whether you need the JSON string data to be copied as a single string column of the new document in your cosmos sink data.
- Or it needed to be copied as a proper JSON document.
Solution 1 for the First Scenario:
As the serverless cosmos db is not supported in mapping dataflow, take a temporary Delimited file dataset with any special character like |
or tab
(special characters which does not exist in your JSON sink) as a column delimiter.
Give this dataset as dataflow sink. In the dataflow sink, go to settings -> output to single file -> give file name. This generates only a single file, but you can avoid it if not needed for your requirement.
Now, in the pipeline, take a Copy activity after the dataflow activity. In the copy activity, take the above delimited text dataset as source and your serverless cosmos db dataset as sink. Select the required Write behavior.
Upon the running the pipeline, first the JSON strings data will be copied to the temporary delimited file and then the copy activity will copy the same to the required cosmos target.
Solution 2 for the Second Scenario:
Here, after the above steps in your mapping dataflow, take a Parse transformation and parse the JSON string in each row to a proper JSON object. You need to define the schema here. After that, take a temporary JSON file dataset as dataflow sink and follow the same above steps if you need it as a single file.
After the dataflow activity, take Copy activity and give the above JSON dataset as source and your cosmos db dataset as target. Set the required mapping in the copy activity mapping section.
This will generate the required JSON document in the target cosmos database.
Hope this helps.
If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment