How to delete an entire Azure Table in one command


Deleting an Entire Azure Table

001

  1. How to delete an entire Azure table is quite easy.
  2. I get this question quite often. I normally would not create such a simple post.
    1. Most developers think they need to delete rows, one row at a time.
    2. But that isn't true.
  3. There is support for deleting a whole table.
  4. Here is the REST-based approach
  5. 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.