Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

249
Views
Sending list of images to azure function to upload image to blob in .Net

I am trying to upload images to blob from my android app. My current approach is uploading images using azureblobsdk which allows me to upload images directly to the blob but now what I am trying is creating an azure function that would accept data in stream or byte array and will store it to my blob.

while uploading the image from my app I used to send some metadata in the string to my app.

  var blobClient = containerClient.GetBlobClient(fileName);
        Dictionary<string, string> metadataProperties = new Dictionary<string, string>();
        metadataProperties.Add(key, value);
        await blobClient.SetMetadataAsync(metadataProperties);

here is what I am doing right now from the app

now I am trying this same thing to do from azure by sending those parameters to the azure function but the problem is I am unable to understand how would I send those streams and metadata to the azure function so that I can process them in my azure function

here is till now what I have done since I am new to azure function so need help to move forward with some approach

   [FunctionName("UploadProductImages")]
    public async Task<HttpResponseMessage> UploadProductImages([HttpTrigger(AuthorizationLevel.Function, "post", Route = "product/uploadimages")] HttpRequestMessage req, Microsoft.Extensions.Logging.ILogger log)
    {
    }

now with this function in place how do I access the data sent from my app which would be a list of images with metadata I am even confused about what should I send a stream or byte array

my final target is to get the list of images with some metadata of those images and upload to blob azure blob storage

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

If I understand the problem correctly, you can do something like this

Create a Model for you data and send it like this

HttpClient apiClient = new HttpClient();
 using (var message = new HttpRequestMessage(HttpMethod.Post, functionAppLink))
        {
            message.Content = new StringContent(JsonConvert.SerializeObject(model),Encoding.UTF8, "application/json");
            var response = await apiClient.SendAsync(message);   
        }

On Function app side just retrieve and deserialize

[FunctionName("UploadProductImages")]
    public async Task<HttpResponseMessage> UploadProductImages([HttpTrigger(AuthorizationLevel.Function, "post", Route = "product/uploadimages")] HttpRequestMessage req, Microsoft.Extensions.Logging.ILogger log)

        {
            using var sr = new StreamReader(req.Body);
            var input = await sr.ReadToEndAsync();
            var model = JsonConvert.Deserialize<Model>(input);
            // Do your thing
        }
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!