locked
UploadFromStreamAsync have a different behaviour in IIS express and Azure Free WebSites RRS feed

  • Question

  • I am currently developing a MVC 5 web application. I am facing a problem when uploading a blob (azure blob storage) in async. My async controller ActionResult use this code: 

    [HttpPost] [ValidateAntiForgeryToken] public async Task<ActionResult> Index(file model) { BlobStorageService blobStorageService = new BlobStorageService(); CloudBlobContainer blobContainer = await blobStorageService.GetCloudBlobContainer(); CloudBlockBlob blob = blobContainer.GetBlockBlobReference("video.mp4"); blob.Properties.ContentType = model.Video.ContentType;

    await blob.UploadFromStreamAsync(model.Video.InputStream);

    return View(); }

    Everything works fine asynchronously on IIS Express but not when I deploy it on Windows Azure Free Websites, UploadFromStreamAsync stop working asynchronously.

    Any idea?

    Thursday, October 9, 2014 2:51 PM

All replies

  • I am currently developing a MVC 5 web application. I am facing a problem when uploading a blob (azure blob storage) in async. My async controller ActionResult use this code: 

    [HttpPost] [ValidateAntiForgeryToken] public async Task<ActionResult> Index(file model) { BlobStorageService blobStorageService = new BlobStorageService(); CloudBlobContainer blobContainer = await blobStorageService.GetCloudBlobContainer(); CloudBlockBlob blob = blobContainer.GetBlockBlobReference("video.mp4"); blob.Properties.ContentType = model.Video.ContentType;

    await blob.UploadFromStreamAsync(model.Video.InputStream);

    return View(); }

    Everything works fine asynchronously on IIS Express but not when I deploy it on Windows Azure Free Websites, UploadFromStreamAsync stop working asynchronously.

    Any idea?


    Thursday, October 9, 2014 2:24 PM
  • Hi,

    As far as I know, the detailed error message is useful for us to debug this issue, refer to  http://azure.microsoft.com/en-us/documentation/articles/web-sites-enable-diagnostic-log/ for more details, you could also use remote debug to do some troubleshot, see the detailed steps here: http://azure.microsoft.com/blog/2014/05/06/introduction-to-remote-debugging-on-azure-web-sites/, from my experience, I suggest you check your file model to see whether the model.Video.InputStream is null or not when it runs at Windows Azure Websites.

    Best Regards,

    Jambor


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Friday, October 10, 2014 8:19 AM
  • Thank you for your reply and for the diagnostics links. But functionally everything works, the videostream is correct, the upload is successful, the only problem is that the task in not executed in asynchronous mode.
    Friday, October 10, 2014 9:09 AM
  • Is there any error reported when you use asynchronous mode?

    How do you know the task is not executed in asynchronous mode?

    Thank you.


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Friday, November 28, 2014 3:30 AM
  • Hi,

    Any updates?

    Regards,
    Malar.

    Thursday, December 4, 2014 10:01 AM