0
votes

I have Azure Storage Account which contains files in Blob Container. I want to send alert, if a file is sitting in one of the sub folders in a container for more than a day.

So, can anyone suggest me how we can get an alert on “aged files” in Azure Storage Account Containers.

1
Maybe you can use Recurrence trigger in azure logic app to run the workflow once a day. You can get blob's metadata such as LastModified to compare with the current time. If the time difference is more than 24 hours, you can send an e-mail to remind yourself. My only concern is that if it runs once a day, there may be blobs that exist for nearly two days before being discovered, so I want to ask if you have any requirements for timeliness.Frank Gong
Yes Frank Gong, I have the requirements for the timeliness. If possible please share code to get blob's LastModified time to compare with the CurrentTimePradeep

1 Answers

1
votes

I designed a workflow in azure logic app. You can use Azure Storage Blob connecter to list blobs in your container, then you can use for each to traverse your blobs:

enter image description here

enter image description here

Within the for each action, you need to use condition action to compare its time. Here, I use the current time minus 24 hours to compare with the last modified time of the blob.

enter image description here

addHours expression

addHours(utcNow('yyyy-MM-ddTHH:mm:ss'),-24,'yyyy-MM-ddTHH:mm:ss')

=================update========================

enter image description here

enter image description here

enter image description here