Cloud Zone is brought to you in partnership with:

My name is Bruno Terkaly and I am a Developer Evangelist in Northern California. Over the past few months I have been presenting a wide variety of demos and slides highlighting the wealth of new features in Visual Studio 2008. Bruno is a DZone MVB and is not an employee of DZone and has posted 42 posts at DZone. You can read more from them at their website. View Full User Profile

How to Delete an Entire Azure Table in One Command

11.18.2012
| 1942 views |
  • submit to reddit


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 

// 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");


Published at DZone with permission of Bruno Terkaly, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)