@Varun Thank you for reaching out to Microsoft Q&A. I understand that you want to get the Lastmodified Timestamp of a recent blob in Azure and want to know the fastest way to get it.
You can get it as discussed in this thread- https://social.msdn.microsoft.com/Forums/en-US/90465e17-5f85-4075-92df-248b8abe7052/get-most-recent-last-modified-file-name-from-containers-subfolder?forum=windowsazuredata
# Connect to Azure with an interactive dialog for sign-in
#Connect-AzAccount
$container_name = 'containername'
$connection_string = 'DefaultEndpointsProtocol=https;AccountName=AccName;AccountKey=AccKey'
$storage_account = New-AzStorageContext -ConnectionString $connection_string
# Get the blobs list and then sort them by last modified date descending
$blobs = Get-AzStorageBlob -Container $container_name -Context $storage_account -Blob *.bak | sort @{expression="LastModified";Descending=$true}
$latestBlob = $blobs[0]
write $latestBlob.Name
Does this help or are you looking for something more? Please let me know. Thanks!
Remember:
Please accept an answer if correct. Original posters help the community find answers faster by identifying the correct answer. Here is how.
Want a reminder to come back and check responses? Here is how to subscribe to a notification.