MetricSign
EN|NLRequest Access
Medium severitydata source

Power BI Refresh Error:
DF-Cosmos-DeleteDataFailed

What does this error mean?

The ADF Mapping Data Flow Cosmos DB sink failed to delete data from the target container. The delete operation was rejected by Cosmos DB, which prevents the data flow from completing the write step.

Common causes

  • 1The Cosmos DB account key or service principal used by the linked service lacks write/delete permissions on the target container
  • 2The sink is configured for 'delete' row type but the incoming stream does not include a valid partition key value, which Cosmos DB requires to locate and delete the document
  • 3The target Cosmos DB container has a TTL (Time to Live) or change feed conflict that prevents the delete operation from succeeding

How to fix it

  1. 1Open the failing data flow in ADF Studio and inspect the Cosmos DB sink transformation settings.
  2. 2Verify the sink row type is set correctly — if 'delete' is selected, confirm the partition key column is mapped and contains non-null values.
  3. 3Test connection the Cosmos DB linked service to confirm the account key or credentials are still valid.
  4. 4In the Azure portal, check the Cosmos DB account keys — regenerated or expired keys break the linked service silently.
  5. 5Enable data flow Debug mode and preview the sink input to confirm the documents being targeted for deletion exist and have valid partition keys.
  6. 6Review the Cosmos DB diagnostic logs in Azure Monitor for 403 (forbidden) or 404 (not found) errors during the same time window.

Frequently asked questions

Does the delete fail silently or does the whole data flow stop?

The entire data flow activity fails — no partial deletes occur. The Cosmos DB sink operation is rolled back and the pipeline run is marked as failed.

What permissions does ADF need to delete Cosmos DB documents?

The identity needs the 'Cosmos DB Built-in Data Contributor' role — read-only roles are not sufficient for delete operations.

My partition key column has values — why does the delete still fail?

If partition key values don't match any existing documents (due to type mismatch or case difference), Cosmos DB returns 404 for each document, which the connector surfaces as DeleteDataFailed.

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

Other data source errors