Medium severitydata source
Power BI Refresh Error:
DF-Cosmos-InvalidAccountKey
What does this error mean?
The ADF Mapping Data Flow Cosmos DB linked service contains an invalid account key. The key stored in the linked service does not match any active key on the Cosmos DB account.
Common causes
- 1The Cosmos DB account's primary or secondary key was regenerated in the Azure portal and the linked service was not updated with the new key
- 2The account key in the linked service was truncated, corrupted, or has extra whitespace from a manual copy-paste
- 3The linked service references the read-only key but the data flow requires a read-write key for write operations
How to fix it
- 1Open the Azure portal and go to your Cosmos DB account → Keys.
- 2Copy the full Primary key (or Secondary key as a fallback) — ensure no trailing spaces or line breaks are included.
- 3Open the Cosmos DB linked service in ADF Studio, update the account key field with the copied value, and click 'Test connection' to verify.
- 4If the pipeline performs write operations, confirm you are using a read-write key (not the read-only key shown in a separate section on the Keys page).
Frequently asked questions
Official documentation: https://learn.microsoft.com/en-us/azure/data-factory/data-flow-troubleshoot-guide