title: Fetch Azure blob metadata only if the blob exists
body: <p>I need to fetch the metadata for an Azure blob if it exists and would like to achieve this with minimal REST calls (by the storage SDK to the storage service)</p>
  
  <p>I know I can do something like</p>
  
  <ul>
  <li><code>CloudBlockBlob.ExistsAsync()</code> and then </li>
  <li><code>CloudBlockBlob.FetchAttributesAsync()</code> if the blob exists</li>
  </ul>
  
  <p>I tried to combine these 2 calls into one</p>
  
  <ul>
  <li><code>CloudBlockBlob.FetchAttributesAsync(AccessCondition.GenerateIfExistsCondition(),new BlobRequestOptions(), new OperationContext());</code></li>
  </ul>
  
  <p>Docs on '<a href="https://docs.microsoft.com/en-us/dotnet/api/microsoft.windowsazure.storage.accesscondition.generateifexistscondition?view=azure-dotnet" rel="nofollow noreferrer">AccessCondition.GenerateIfExistsCondition()</a>' say - </p>
  
  <blockquote>
    <p>Constructs an access condition such that an operation will be
    performed only if the resource exists.</p>
  </blockquote>
  
  <p>but it still fails with a 404 not found. </p>
  
  <p>Any idea if what I want to achieve is even possible and what I might be doing wrong?</p>