Getting "Azure.RequestFailedException" while running Azure Function

Amar Agnihotri 891 Reputation points

I have created an Azure Function which is of Blob Trigger type . It will read a data from blob ( having invalid format of json ) and will convert it to a valid json file. I am trying to run this function but it is showing "Azure.RequestFailedException" . Can anybody suggest any solution to get rid of this exception. Am i missing anything like permissions etc in azure portal.

This is my function code -

using System;
using System.IO;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Host;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;

namespace ConBlobJSON
public class Function1
public void Run([BlobTrigger("powerbi-admin/AD_User_data/{AD_User}", Connection = "AzureWebJobsStorage")]Stream myBlob, ILogger log)
log.LogInformation($"C# Blob trigger function Processed blob\n Name: \n Size: {myBlob.Length} Bytes");
var serializer = new JsonSerializer();
using (var sr = new StreamReader(myBlob))
using (var jsonTextReader = new JsonTextReader(sr))

                dynamic data = serializer.Deserialize(jsonTextReader);  
                var newString = "";  
                int i = 0;  
                foreach (var res in data)  
                    if (res != null)  
                        if (i == 0)  
                            newString = Convert.ToString(res);  
                            newString = newString + "," + Convert.ToString(res);  
                newString = "[" + newString + "]";  
                // Do something with person.  
        catch (Exception ex)  


This is my connection setting

This is the exception

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,228 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,424 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruno Lucas 4,411 Reputation points MVP

    Hi @Amar Agnihotri

    I tried to reproduce the problem but didn't get this error.
    Found this post that post commenting on similar issue but the code works and throws exception for this user:

    What version of .Net and Microsoft.Azure.WebJobs.Extensions.Storage are you using?

    1 person found this answer helpful.