title: Azure Cloud Storage SDK UploadFromStreamAsync storing 0 bytes
body: <p>I am using ASP.NET Core 2.1 Azure Cloud Storage SDK UploadFromStreamAsync method to upload stream as azure blob. The blob is created but size shows 0 bytes. Below is my code. Anyone can tell me if I am missing something ? </p>
  
  <pre><code>   [HttpPost]
          public async Task&lt;IActionResult&gt; PostRecordedAudioVideo()
          {
              var file = Request.Form.Files[0];
  
              if (file.Length &gt; 0)
              {
                  var stream = new MemoryStream();
  
                  await this.Request.Body.CopyToAsync(stream);
  
                  CloudStorageAccount storageAccount = null;
                  CloudBlobContainer cloudBlobContainer = null;
  
                  string storageConnectionString = Environment.GetEnvironmentVariable("AZURE_STORAGE_CONNECTION_STRING");
  
                  if (CloudStorageAccount.TryParse(storageConnectionString, out storageAccount))
                  {   
                          CloudBlobClient cloudBlobClient = storageAccount.CreateCloudBlobClient();
                          cloudBlobContainer = cloudBlobClient.GetContainerReference("screening-videos");
                          CloudBlockBlob cloudBlockBlob = cloudBlobContainer.GetBlockBlobReference("TestBlobName");
                          await cloudBlockBlob.UploadFromStreamAsync(stream);
                  }
              }
              return Json("Success or failure response");
          }
  </code></pre>