How to delete an entire Azure Table in one command
Deleting an Entire Azure Table
- 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
Sample.cs
Sample.cs | |
12345678910 | // Retrieve storage account from connection stringCloudStorageAccount storageAccount = CloudStorageAccount.Parse( CloudConfigurationManager.GetSetting("StorageConnectionString")); // Create the table clientCloudTableClient tableClient = storageAccount.CreateCloudTableClient(); // Delete the table it if existstableClient.DeleteTableIfExist("people"); |
Cheers,
Hope this helps.