title: The correct way to delete and recreate a Windows Azure Storage Table = Error 409 Conflict - Code : TableBeingDeleted
body: <p>Im really new to  Windows Azure development and have a requirement to store some data in a windows azure storage table.</p>
  
  <p>This table will really only exist to provide a quick lookup mechanism to some files which are located on azure storage drive.</p>
  
  <p>Therefore I was planning on populating this table at application start up (ie in web application global application start up)</p>
  
  <p>Rather than trying to maintain this table for changes the changes that could occur to the drive while the application is not running. Or as this drive is just a vhd of resources, we may well occasionally upload a new vhd.</p>
  
  <p>So rather than the hassle of trying to maintain this. it is sufficient that this table be rebuild upon each application start.</p>
  
  <p>I started to put together some code to check if the table already exists , and if it does delete it, and then recreate a new table.</p>
  
  <pre><code>var storageAccount = CloudStorageAccount.Parse(ConfigurationManager.ConnectionStrings["AzureStorage"].ConnectionString);
  var tableClient = storageAccount.CreateCloudTableClient();
  var rmsTable = tableClient.GetTableReference("ResourceManagerStorage");
  rmsTable.DeleteIfExists();
  rmsTable.Create();
  </code></pre>
  
  <p>I had expected this would not work. And I get the following error:</p>
  
  <pre><code>The remote server returned an error: (409) Conflict. 
  
  HTTP/1.1 409 Conflict
  Cache-Control: no-cache
  Transfer-Encoding: chunked
  Server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
  x-ms-request-id: c6baf92e-de47-4a6d-82b3-4faec637a98c
  x-ms-version: 2012-02-12
  Date: Tue, 19 Mar 2013 17:26:25 GMT
  
  166
  &lt;?xml version="1.0" encoding="utf-8" standalone="yes"?&gt;
  &lt;error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"&gt;
    &lt;code&gt;TableBeingDeleted&lt;/code&gt;
    &lt;message xml:lang="en-US"&gt;The specified table is being deleted. Try operation later.
  RequestId:c6baf92e-de47-4a6d-82b3-4faec637a98c
  Time:2013-03-19T17:26:26.2612698Z&lt;/message&gt;
  &lt;/error&gt;
  0
  </code></pre>
  
  <p>What is the correct way of doing this? Is there an event which can be subscribed to to let you know when the table as been deleted? ANy other suggestions on the best way to implement this?</p>