title: CloudBlockBlob.DeleteAsync throws exception
body: <p>I'm trying to delete a blob snapshot - I don't want to delete anything other than the snapshot for which I have the reference.</p>
  
  <pre><code>await snapshotBlob.DeleteAsync(DeleteSnapshotsOption.None,
                                         acc,
                                         new BlobRequestOptions(),
                                         new OperationContext());
  </code></pre>
  
  <p>I've tried different <code>DeleteSnapshotsOption</code> but the exception tells me that only <code>DeleteSnapshotsOption.None</code> can be used when deleting a snapshot.</p>
  
  <p>The <code>AccessCondition</code> (<code>acc</code>) has only the <code>LeaseID</code> set.</p>
  
  <p>I don't have <code>BlobRequestOptions</code> or <code>OperationContext</code> preferences; I've also tried passing <code>null</code> for those two properties but it makes no difference.</p>
  
  <p>The method call throws "The remote server returned an error: (400) Bad Request."</p>
  
  <p>Stack trace:</p>
  
  <blockquote>
    <p>Microsoft.WindowsAzure.Storage.StorageException    at
    Microsoft.WindowsAzure.Storage.Core.Executor.Executor.EndExecuteAsync[T](IAsyncResult
    result)    at
    Microsoft.WindowsAzure.Storage.Blob.CloudBlob.EndDelete(IAsyncResult
    asyncResult)    at
    Microsoft.WindowsAzure.Storage.Core.Util.AsyncExtensions.&lt;>c__DisplayClass4.b__3(IAsyncResult
    ar)
    --- End of stack trace from previous location where exception was thrown ---    at
    System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task
    task)    at
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
    task)    at
    System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()
    at StorageHooks.StorageBackup.d__0.MoveNext() in [<em>line in my
    code</em>]</p>
  </blockquote>
  
  <p>Can anyone explain what's wrong with the way I'm calling the method?</p>
  
  <p>Also, in case it has an influence, I'm calling this method in an Azure Function. Furthermore, the code is copying existing blobs into another container, and the code works for creating a snapshot, creating the new blob, uploading to the other container, copying metadata, obtaining a lease... The only part which fails is deleting the snapshot.</p>