How to Delete an Entire Azure Table in One Command
The Cloud Zone is brought to you in partnership with Mendix. Better understand the aPaaS landscape and how the right platform can accelerate your software delivery cadence and capacity with the Gartner 2015 Magic Quadrant for Enterprise Application Platform as a Service.
- How to delete an entire Azure table is quite easy.
- I get this question quite often. I normally would not create such a simple post.
- Most developers think they need to delete rows, one row at a time.
- But that isn't true.
- There is support for deleting a whole table.
- Here is the REST-based approach
- Here is the approach using the .NET libraries
// Retrieve storage account from connection string CloudStorageAccount storageAccount = CloudStorageAccount.Parse( CloudConfigurationManager.GetSetting("StorageConnectionString")); // Create the table client CloudTableClient tableClient = storageAccount.CreateCloudTableClient(); // Delete the table it if exists tableClient.DeleteTableIfExist("people");