Hi anonymous user-0048 ,
Thank you for posting in Microsoft Q&A Platform.
There might be two possible causes for this failure. Please check details below.
Root Cause:
- Cause 1: If you use Insert as the write behavior, this error means that your source data has rows or objects with same ID.
- Cause 2: If you use Upsert as the write behavior and you set another unique key to the container, this error means that your source data has rows or objects with different IDs but the same value for the defined unique key.
Resolution:
- For cause 1, set Upsert as the write behavior.
- For cause 2, make sure that each document has a different value for the defined unique key.
Please check below link for more details.
https://learn.microsoft.com/en-us/azure/data-factory/connector-troubleshoot-guide#error-message-unique-index-constraint-violation
Hope this will help. Thank you.
----------------------
- Please
accept an answer
if correct. 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.
Hi @ShaikMaheer-MSFT
Here is the Error message:
Operation on target Copy Data failed: ErrorCode=UserErrorDocumentDBWriteError,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Documents failed to import. Error message:Message: {"Errors":["Encountered exception while executing function. Exception = Error: {\"Errors\":[\"Unique index constraint violation.\"]}\r\nStack trace: Error: {\"Errors\":[\"Unique index constraint violation.\"]}\n at createCallback (script.js:6350:26)\n at Anonymous function (script.js:687:29)"]}
ActivityId: 121121e8-e05a-400d-b309-498215ac7a0d, Request URI: /apps/1226fbb7-a202-4ebf-9f8d-0bf04a09f94d/services/f74ee725-0e2f-402b-ab12-e11b2f74c4a7/partitions/fcc15b0e-6118-40d5-bd48-a6544fe75ca8/replicas/132707862642353341p/, RequestStats:
RequestStartTime: 2021-07-16T16:08:57.7270370Z, RequestEndTime: 2021-07-16T16:08:57.7470650Z, Number of regions attempted:1
Hi anonymous user-0048 ,
Thank you for response and sharing error details. But I would be great if you can share your copy activity details may json of your entire copy activity or screenshots of copy activity configuration. So that We can follow along and reproduce scenario and help on detailed resolution. Thank you.
Hi @ShaikMaheer-MSFT , here is the screenshots of configuration:
Sign in to comment