title: Download blob using Azure Blob storage client library v12 for .NET
body: <p>I am using Azure.Storage.Blobs version=12.4.1.
  I have a REST endpoint that I want to use to download blobs from a storage account.</p>
  
  <p>I need to stream the result to a <strong>HttpResponseMessage</strong> and I do not want to use a MemoryStream. I want to stream the result directly to the calling client. Is there a way to achieve this. How to get the downloaded blob in the HttpResponseMessage content? I do not want to use MemoryStream, since there will be a lot of download requests.</p>
  
  <p>The BlobClient class has a method DownloadToAsync but it requires a Stream as a parameter.</p>
  
  <pre><code>        var result = new HttpResponseMessage(HttpStatusCode.OK);
  
          var blobClient = container.GetBlobClient(blobPath);
          if (await blobClient.ExistsAsync())
          {
              var blobProperties = await blobClient.GetPropertiesAsync();
  
              var fileFromStorage = new BlobResponse()
              {                    
                  ContentType = blobProperties.Value.ContentType,
                  ContentMd5 = blobProperties.Value.ContentHash.ToString(),
                  Status = Status.Ok,
                  StatusText = "File retrieved from blob"
              };
  
              await blobClient.DownloadToAsync(/*what to put here*/);
              return fileFromStorage;
          }
  </code></pre>