Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

How to Delete an Entire Azure Table in One Command

DZone's Guide to

How to Delete an Entire Azure Table in One Command

· Cloud Zone
Free Resource

Production-proven Mesosphere DC/OS is now even better with GPU scheduling, pods, troubleshooting, enhanced security, and over 100+ integrated services deployed in one-click.

Here's how to delete an entire Azure table:


001

 

I get this question quite often. I normally wouldn't make such a simple post, but:

  1. Most developers think they need to delete rows one row at a time.
  2. And that isn't true.

There is, in fact, support for deleting a whole table.

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

Cheers!

Simply build, test, and deploy. Mesosphere DC/OS is the best way to run containers and big data anywhere offering production-proven flexibility and reliability.

Topics:

Published at DZone with permission of Bruno Terkaly, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}