title: .NET Core: Reading Azure Storage Blob into Memory Stream throws NotSupportedException in HttpBaseStream
body: <p>I want to download a storage blob from Azure and stream it to a client via an .NET Web-App. The blob was uploaded correctly and is visible in my Azure storage account.</p>
  <p>Surprisingly, the following throws an exception within HttpBaseStream:</p>
  <pre><code>    [...] 
      var blobClient = _containerClient.GetBlobClient(Path.Combine(fileName));
      var stream = await blobClient.OpenReadAsync();
      return stream;
  </code></pre>
  <p><a href="https://i.stack.imgur.com/7Orjo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7Orjo.png" alt="enter image description here" /></a></p>
  <p>-&gt; When i step further and return a File (<code>return File(stream, MediaTypeNames.Application.Octet);</code>), the download works as intended.</p>
  <p>I tried to push the stream into an MemoryStream, which also fails with the same exception:</p>
  <pre><code>    [...] 
      var blobClient = _containerClient.GetBlobClient(Path.Combine(fileName));
      var stream = new MemoryStream();
      await blobClient.DownloadToAsync(stream);
      return stream
  </code></pre>
  <p>-&gt;When i step further, returning the file results in a timeout.</p>
  <p>How can i fix that? Why do i get this exception - i followed the official quickstart guide from Microsoft.</p>