Skip to content

hierarchical namespace similar to a file system and CloudBlobContainer class inconsistency #1

@tugberkugurlu

Description

@tugberkugurlu

When I create a hierarchical namespace similar to a file system and try to retrieve it with the CloudBlobContainer class, IListBlobItem.Uri comes back incorrectly. Here is a sample:

In my container, I have a file named album/foo.jpg. I try to list the blobs under my container with the following code:

  // Retrieve a reference to a container 
  CloudBlobContainer blobContainer =
      _myBlobStorageService.GetCloudBlobContainer();

  List<string> blobs = new List<string>();

  // Loop over blobs within the container and output the URI to each of them
  foreach (var blobItem in blobContainer.ListBlobs())
      blobs.Add(blobItem.Uri.ToString());

It returns the Uri property of all the blobs correctly if they don't have "/". In this case Uri comes back as http://mystorage.table.core.windows.net/mycontainer/album/ but it should be http://mystorage.table.core.windows.net/mycontainer/album/foo.jpg.

NOTE:

Probably has nothing to do with this but _myBlobStorageService code is as bellow:

    public CloudBlobContainer GetCloudBlobContainer() {

        // Retrieve storage account from connection-string
        CloudStorageAccount storageAccount = CloudStorageAccount.Parse(
                RoleEnvironment.GetConfigurationSettingValue("StorageString")
            );

        // Create the blob client 
        CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();

        // Retrieve a reference to a container 
        CloudBlobContainer blobContainer = blobClient.GetContainerReference("dummy");

        return blobContainer;
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions