Medium severitydata source
Power BI Refresh Error:
DF-Cosmos-InvalidPartitionKeyContent
What does this error mean?
The ADF Mapping Data Flow Cosmos DB sink found a partition key value in the incoming data that violates Cosmos DB's partition key content rules — such as a value that exceeds the 2 KB size limit, is of an unsupported type, or is empty.
Common causes
- 1One or more rows contain a partition key value that is null, empty, or exceeds 2 KB in size — Cosmos DB enforces a strict 2 KB limit on partition key values
- 2The partition key column contains an unsupported data type (e.g., array or object) rather than a scalar value (string, number, or boolean)
- 3An upstream transformation produces partition key values with leading/trailing whitespace or special characters that Cosmos DB rejects
How to fix it
- 1Enable data flow Debug mode and preview the Cosmos DB sink input — filter to rows where the partition key column is null, empty, or suspiciously long.
- 2Add a Filter transformation to exclude rows with null or empty partition key values before they reach the sink.
- 3Add a Derived Column transformation to trim, truncate, or normalize the partition key value if it contains whitespace or exceeds size limits.
- 4Confirm the partition key column data type is string, integer, or boolean — if it's an object or array, extract the scalar property you intend to use as the key.
Frequently asked questions
Official documentation: https://learn.microsoft.com/en-us/azure/data-factory/data-flow-troubleshoot-guide