Azure Storage: FetchAttributes call hangs RRS feed

  • Question

  • Thanks. I am finally able to get the blob type using the HEAD request.

    However, I see a new problem

    I have created a method for accessing the blob type:

    public static ICloudBlob GetBlob(Uri uri)
                HttpWebRequest request = HttpWebRequest.Create(uri) as HttpWebRequest;
                request.Method = "GET";
                var response = request.GetResponse();
                if (response.Headers["x-ms-blob-type"] == "BlockBlob")
                    return new CloudBlockBlob(uri);
                else if (response.Headers["x-ms-blob-type"] == "PageBlob")
                    return new CloudPageBlob(uri);
                throw new Exception("Invalid Blob type");

    On calling this method 2 times consecutively ,

    ICloudBlob blo2 = GetBlob(new Uri(uri));
    ICloudBlob blo4 = GetBlob(new Uri(uri));

    and then calling blo4.FetchAttributes()

    causes the FetchAttributes call to hang.

    However the call to FetchAttributes is successful if I have Fiddler running

    • Split by Manu Rekhar Monday, March 23, 2015 7:26 PM New issue
    Thursday, March 19, 2015 9:23 PM


  • Hi,

    I have split this post from it's parent thread as it is a new issue.

    Try fetching properties and metadata after each "ICloudBlob blo2 = GetBlob(new Uri(uri));" and again after "ICloudBlob blo4 = GetBlob(new Uri(uri));", check if FetchingAttributes hangs.

    Also, knowing the type of your blob and you want to download all properties, metadata, and the contents of the blob, you can directly call DownloadToStream.

    DownloadToStream internally makes a Get Blob REST API request, which returns blob's properties and metadata.

    Hope DownloadToStream will solve your problem.

    Manu Rekhar

    Monday, March 23, 2015 7:29 PM