title: Azure FileStorage CloudFile
body: <p>I am trying to programmatically download a file I have just saved into Azure File Storage and I am getting a </p>
  
  <blockquote>
    <p>{"The remote server returned an error: (400) Bad Request."}</p>
  </blockquote>
  
  <p>when I call the DownloadToStream method.  What am doing wrong?<br>
  Any help would be greatly appreciated. Thanks!</p>
  
  <p>Here is the code:</p>
  
  <pre><code>        var combinedRelativeDirectory = GetCloudDirectory(relativePath);
          CloudFile cloudFile = null;
  
          cloudFile = combinedRelativeDirectory.GetFileReference(filename);
          var memoryStream = new MemoryStream();
  
          cloudFile.DownloadToStream(memoryStream, AccessCondition.GenerateIfExistsCondition());
          memoryStream.Position = 0;
          return memoryStream;
  </code></pre>