MetricSign
EN|NLRequest Access
Medium severitydata source

Power BI Refresh Error:
DF-Cosmos-PartitionKeyMissed

What does this error mean?

The ADF Mapping Data Flow Cosmos DB sink configuration is missing a partition key mapping. Cosmos DB requires every document to include the partition key property, but neither the sink settings nor the incoming data stream specifies which column to use as the partition key.

Common causes

  • 1The partition key property is not configured in the Cosmos DB sink transformation settings — the 'Partition key name' field is empty
  • 2The column designated as the partition key was dropped by an upstream Select transformation before reaching the sink
  • 3The data flow was copied from a Cosmos DB container with a different schema, and the partition key column name in the copy does not exist in the new source schema

How to fix it

  1. 1Open the Cosmos DB sink transformation in ADF Studio and go to Settings tab.
  2. 2Set the 'Partition key name' field to the column that contains the partition key values — this must match the container's partition key path without the leading slash.
  3. 3Confirm the named column exists in the incoming stream using Debug data preview on the sink input.
  4. 4If the column was dropped upstream, trace back through Select and Rename transformations to restore it before the sink.

Frequently asked questions

What's the difference between PartitionKeyMissed and InvalidPartitionKey?

PartitionKeyMissed means no partition key is configured — the sink settings are missing the field. InvalidPartitionKey means a partition key is configured but doesn't match the container's actual partition key definition.

Does the partition key name in the sink settings need a leading slash?

No — in the Cosmos DB sink Settings tab, enter the column name without a slash (e.g., 'userId'). The leading slash is only used in the container's partition key path definition in Azure.

Can I set the partition key value in a Derived Column instead of relying on source data?

Yes — add a Derived Column before the sink to compute or assign the partition key value, then reference that column in the sink's partition key name field.

Official documentation: https://learn.microsoft.com/en-us/azure/data-factory/data-flow-troubleshoot-guide

Other data source errors