Skip to content

Commit 7752d75

Browse files
Merge pull request #235163 from Clare-Zheng82/0420-Update_cosmosdb_tsg
Update Cosmos DB TSG
2 parents ae6f9de + 3925119 commit 7752d75

File tree

1 file changed

+31
-4
lines changed

1 file changed

+31
-4
lines changed

articles/data-factory/connector-troubleshoot-azure-cosmos-db.md

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: jianleishen
66
ms.service: data-factory
77
ms.subservice: data-movement
88
ms.topic: troubleshooting
9-
ms.date: 07/29/2022
9+
ms.date: 04/20/2023
1010
ms.author: jianleishen
1111
ms.custom: has-adal-ref, synapse, ignite-2022
1212
---
@@ -21,9 +21,36 @@ This article provides suggestions to troubleshoot common problems with the Azure
2121

2222
- **Symptoms**: When you copy data into Azure Cosmos DB with a default write batch size, you receive the following error: `Request size is too large.`
2323

24-
- **Cause**: Azure Cosmos DB limits the size of a single request to 2 MB. The formula is *request size = single document size \* write batch size*. If your document size is large, the default behavior will result in a request size that's too large. You can tune the write batch size.
25-
26-
- **Resolution**: In the copy activity sink, reduce the *write batch size* value (the default value is 10000).
24+
- **Cause**: Azure Cosmos DB limits the size of a single request to 2 MB. The formula is *request size = single document size \* write batch size*. If your document size is large, the default behavior will result in a request size that's too large.
25+
26+
- **Resolution**: <br>
27+
You can tune the write batch size. In the copy activity sink, reduce the *write batch size* value (the default value is 10000). <br>
28+
If reducing the *write batch size* value to 1 still doesn't work, change your Azure Cosmos DB SQL API from V2 to V3. To complete this configuration, you have two options:
29+
30+
- **Option 1**: Change your authentication type to service principal or system-assigned managed identity or user-assigned managed identity.
31+
- **Option 2**: If you still want to use account key authentication, follow these steps:
32+
1. Create an Azure Cosmos DB for NoSQL linked service.
33+
2. Update the linked service with the following template.
34+
35+
```json
36+
{
37+
"name": "<CosmosDbV3>",
38+
"type": "Microsoft.DataFactory/factories/linkedservices",
39+
"properties": {
40+
"annotations": [],
41+
"type": "CosmosDb",
42+
"typeProperties": {
43+
"useV3": true,
44+
"accountEndpoint": "<account endpoint>",
45+
"database": "<database name>",
46+
"accountKey": {
47+
"type": "SecureString",
48+
"value": "<account key>"
49+
}
50+
}
51+
}
52+
}
53+
```
2754

2855
## Error message: Unique index constraint violation
2956

0 commit comments

Comments
 (0)