Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

254
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda