How to get folder list from azure container?

Viewed 2934

I would like to fetch all the folder and files in a azure container in nodejs

I am using azure-storage library to get blob, but not able to find any example to list all the folder under a container. I am dumping (export) my anaylitics data to the storage container in auzure. Now i tried to read these files

My storage structure like

ios-analytics-full/ios_06cd82e4db0845b9bef73c5b22bea2fa/Event/2016-09-29/18/270b58c-04d7-4e5d-a503-cdce24a3940c_20160929_184723.blob

I want to read all folder created for each day and files under these folders

var containerName = "assist-ios-analytics-full";


blobService.listBlobsSegmented(containerName, null, {maxResults : 10}, function(err, result) {
    if (err) {
        console.log("Couldn't list blobs for container %s", containerName);
        console.error(err);
    } else {
        console.log('Successfully listed blobs for container %s', containerName);
        console.log(result.entries);
        console.log(result.continuationToken);
        res.json(result);
    }
});

latest folder would be today date

ios-analytics-full/ios_06cd82e4db0845b9bef73c5b22bea2fa/Event/2017-05-31/18/270b58c-04d7-4e5d-a503-cdce24a3940c_20160929_184723.blob
1 Answers
Related