Hi Khushaal Kurswani,
You're correct that the LastModified
date of a blob in Azure Blob Storage is system-managed and cannot be directly modified. The BlobProperties.LastModified
property is indeed a read-only property, and there is no setter for it.
I suggest few steps you can take to troubleshoot the issue. There are a few indirect ways to influence the LastModified
date:
Copying the Blob: You can create a copy of the blob. When you copy a blob, the new blob will have a new LastModified
date corresponding to the time of the copy operation. This effectively gives you a new blob with a current LastModified
date.
Updating Metadata or Properties: Any operation that modifies the blob, including updating its metadata or properties, will change the LastModified
date. For example, you can add or update a metadata key-value pair to trigger an update to the LastModified
date
Re-uploading the Blob: If you re-upload the blob, it will have a new LastModified
date corresponding to the time of the upload. This is similar to copying the blob but involves uploading the data again.
Unfortunately, for a soft-deleted blob, these operations would need to be performed after restoring the blob, as the LastModified
date cannot be directly modified during the soft-deleted state.
For more information:
https://learn.microsoft.com/en-us/dotnet/api/azure.storage.blobs.models.blobproperties.lastmodified?view=azure-dotnet
Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.
If you have any other questions or are still running into more issues, let me know in the "comments" and I would be happy to help you.