I am trying to get the LastModified date for a blockblob.
I find the block blob the same way as shown in another stackoverflow post: https://stackoverflow.com/a/60082240/2759759
var cloudStorageAccount = CloudStorageAccount.Parse(variable);
var cloudBlobClient = cloudStorageAccount.CreateCloudBlobClient();
var cloudBlobContainer = cloudBlobClient.GetContainerReference(BlobContainerName);
var cloudBlockBlob = cloudBlobContainer.GetBlockBlobReference(blobFile);
var blobDateTime = cloudBlockBlob.Properties.LastModified; // returns null
var cloudBlockBlob2 = cloudBlockBlob.CreateSnapshot();
var blobDateTime2 = cloudBlockBlob2.Properties.LastModified; // returns desired date time information
When the above is run, blobDateTime will be null, blobDateTime2 will have the desired information. Why did I need to create a Snapshot in order to get the date last modified? What is least expensive way to get the LastModified information. Creating a snapshot isn't instantaneous so it's probably doing more in the background than what I need to do if I just want the modified date.