locked
Resize Images on Azure blob after uploading them RRS feed

  • Question

  • User-375223641 posted

    Hello,

    I'm uploading images using Web API to Azure Blob, I want to resize the uploaded image if the dimensions are greater than 900*900 and then create a thumbnail image.

    I created an Azure function using Azure templates but it is not firing when I upload an image or resize the image even when I run it manually. I don't know what is wrong with it,I'm a newbie still with Azure!! Is there a better way to do that with C# and Azure?

    Thanks

    Tuesday, April 3, 2018 8:37 PM

Answers

  • User753101303 posted

    Hi,

    It seems the error is that you are trying to read a blob from the "images" location while it should be "images/blobName". I assume "images" is a container for your blobs ?

    Basically a "container" is likely a folder but you still have to tell which "file" (ie blob name) you want to retrieve.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, April 4, 2018 1:45 PM

All replies

  • User283571144 posted

    Hi elshorbagy,

    According to your description, I couldn't directly find the reason why your azure function doesn't work.

    Could you please post the details error message about your azure function?

    Do you set the right blob path when you create the azure function?

    Besides, I suggest you could follow below tutorial.

    http://jameschambers.com/2016/11/Resizing-Images-Using-Azure-Functions/ 

    Best Regards,

    Brando

    Wednesday, April 4, 2018 5:40 AM
  • User-375223641 posted

    This is the log

    2018-04-04T13:24:10  Welcome, you are now connected to log-streaming service.
    2018-04-04T13:24:20.376 [Info] Function started (Id=82e55ea3-4c25-44dd-aaf7-e9ded13c2de1)
    2018-04-04T13:24:20.764 [Error] Exception while executing function: Functions.ResizeImageCSharp1. Microsoft.Azure.WebJobs.Host: Exception binding parameter 'images'. Microsoft.Azure.WebJobs.Host: Blob identifiers must be in the format 'container/blob'.


    Wednesday, April 4, 2018 1:27 PM
  • User753101303 posted

    Hi,

    It seems the error is that you are trying to read a blob from the "images" location while it should be "images/blobName". I assume "images" is a container for your blobs ?

    Basically a "container" is likely a folder but you still have to tell which "file" (ie blob name) you want to retrieve.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, April 4, 2018 1:45 PM
  • User-375223641 posted

    It is working now. Thank you.

    Wednesday, April 4, 2018 6:09 PM