title: How to delete Azure blob from asp.net web api?
body: <p>Uploading images from my web api to azure blob storage works fine, altough when trying to delete them i get the following error: 
  "An exception of type 'Microsoft.WindowsAzure.Storage.StorageException' occurred in Microsoft.WindowsAzure.Storage.dll but was not handled in user code"</p>
  
  <p>This is the code im using: </p>
  
  <pre><code>// Retrieve storage account from connection string.
  CloudStorageAccount storageAccount = CloudStorageAccount.Parse(
  CloudConfigurationManager.GetSetting("StorageConnectionString"));
  
  // Create the blob client.
  CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
  
  // Retrieve reference to a previously created container.
  CloudBlobContainer container = blobClient.GetContainerReference("mycontainer");
  
  // Retrieve reference to a blob named "myblob.txt".
  CloudBlockBlob blockBlob = container.GetBlockBlobReference("myblob.txt");
  
  // Delete the blob.
   blockBlob.Delete();
  </code></pre>
  
  <p>The code im trying to use comes from: <a href="https://azure.microsoft.com/sv-se/documentation/articles/storage-dotnet-how-to-use-blobs/#delete-blobs" rel="nofollow">https://azure.microsoft.com/sv-se/documentation/articles/storage-dotnet-how-to-use-blobs/#delete-blobs</a></p>
  
  <p>Any help or input highly appreciated, thanks!</p>