I have azure blob container
named azure-con
inside that have folder test-data
inside this folder multiple folders gets created based on date year and minutes 0
, 1
inside this 21
,22
and so on.
I want to get the file from latest folder path would be-
azure-con/1/22/333.json
I tried this code but does not work for me unable to get the latest folder and file inside that using LastModified -
var containerName = "azure-con";
var latestBlob = containerName
.OfType<CloudBlockBlob>()
.OrderByDescending(m => m.Properties.LastModified).FirstOrDefault();
//var blobName = "azure-con/1/22/333.json";
I want to pass this above blobName from latestBlob code which gives latest file path
var storageAccount = CloudStorageAccount.Parse(connectionString);
var blobClient = storageAccount.CreateCloudBlobClient();
var container = blobClient.GetContainerReference(containerName);
var blob = container.GetBlockBlobReference(blobName);