title: Azure Table Storage batch insert with potentially pre-existing rowkeys
body: <p>I'm trying to send a simple batch of Insert operations to Azure Table Storage but it seems that the whole batch transaction is invalidated and, using the managed azure storage client, the ExecuteBatch method itself throws an Exception if there is a single Insert in the batch to a pre-existing record. (using 2.0 client):</p>
  
  <pre><code>public class SampleEntity : TableEntity
  {
      public SampleEntity(string partKey, string rowKey)
      {
          this.PartitionKey = partKey;
          this.RowKey = rowKey;
      }
  }
  
  
  var acct = CloudStorageAccount.DevelopmentStorageAccount;
  var client = acct.CreateCloudTableClient();
  var table = client.GetTableReference("SampleEntities");
  
  var foo = new SampleEntity("partition1", "preexistingKey");
  var bar = new SampleEntity("partition1", "newKey");
  
  var batchOp = new TableBatchOperation();
  batchOp.Add(TableOperation.Insert(foo));
  batchOp.Add(TableOperation.Insert(bar));
  
  var result = table.ExecuteBatch(batchOp);  // throws exception: "0:The specified entity already exists."
  </code></pre>
  
  <p>The batch-level exception is avoided by using InsertOrMerge but then every individual operation response returns a 204, whether or not that particular operation inserted or merged it.  So it seems its impossible for the client application to retain knowledge of whether it, or another node in the cluster, inserted the record.  Unforunately, in my current case, this knowledge is necessary for some downstream synchronization.</p>
  
  <p>Is there some configuration or technique to allow the batch of inserts to proceed and return the particular response code per-item without throwing a blanket exception?</p>