How to enable partition key delete feature for my Azure cosmos account?

Sharuk Abdul Gafoor 0 Reputation points
2024-06-26T06:31:25.76+00:00
var deleteResponse = await container.DeleteAllItemsByPartitionKeyStreamAsync(new PartitionKey(partitionKey));

I have used this code snippet from referring - https://video2.skills-academy.com/en-us/azure/cosmos-db/nosql/how-to-delete-by-partition-key?tabs=dotnet-example

Getting exception: Message: {"Errors":["Partition key delete feature is disabled for this account. Please contact Azure Support [https://azure.microsoft.com/support] to enable it."]}

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,518 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Sajeetharan 2,031 Reputation points Microsoft Employee
    2024-06-26T10:49:31.8366667+00:00

    You need to enable the feature first before consuming it, you can follow the steps below

    https://video2.skills-academy.com/en-us/azure/cosmos-db/nosql/how-to-delete-by-partition-key?tabs=dotnet-example#getting-started

    0 comments No comments