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?
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
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'.
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.
Member
36 Points
153 Posts
Resize Images on Azure blob after uploading them
Apr 03, 2018 08:37 PM|elshorbagy|LINK
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
Star
9831 Points
3120 Posts
Re: Resize Images on Azure blob after uploading them
Apr 04, 2018 05:40 AM|Brando ZWZ|LINK
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
Member
36 Points
153 Posts
Re: Resize Images on Azure blob after uploading them
Apr 04, 2018 01:27 PM|elshorbagy|LINK
This is the log
All-Star
48740 Points
18196 Posts
Re: Resize Images on Azure blob after uploading them
Apr 04, 2018 01:45 PM|PatriceSc|LINK
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.
Member
36 Points
153 Posts
Re: Resize Images on Azure blob after uploading them
Apr 04, 2018 06:09 PM|elshorbagy|LINK
It is working now. Thank you.