How to Delete an Entire Azure Table in One Command
The Cloud Zone is brought to you in partnership with Iron.io. Discover how Microservices have transformed the way developers are building and deploying applications in the era of modern cloud infrastructure.
Here's how to delete an entire Azure table:
I get this question quite often. I normally wouldn't make such a simple post, but:
There is, in fact, support for deleting a whole table.
- Here's the REST-based approach: http://msdn.microsoft.com/en-us/library/windowsazure/dd179387.aspx
- Here's the approach using the .NET libraries: http://www.windowsazure.com/en-us/develop/net/how-to-guides/table-services/#delete-table
// 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");