Azure File share

Vasudev Reddy Ganganna 1 Reputation point
2021-08-18T10:26:11.657+00:00

Hi All, I have created a Azure File share under storage account and i am looking a small custom script to generate an alert to application team if a file sits more than 5 mins in Azure file share . i could not find predefined option to do this kind of alert in Azure. So Seeking help if any one already have this type of requirement and done the alerts?

Azure Files
Azure Files
An Azure service that offers file shares in the cloud.
1,171 questions
{count} votes

1 answer

Sort by: Most helpful
  1. shiva patpi 13,141 Reputation points Microsoft Employee
    2021-08-20T23:52:49.76+00:00

    Hello @Vasudev Reddy Ganganna ,
    As said by Sumanth you can do that using the powershell.
    I was just trying to simulate your requirements using C#.net , below are the sample code snippet . Let us know if that helps.
    Reference document from which below code snippet is customized , it is a console based dotnet application:
    https://learn.microsoft.com/en-us/azure/storage/files/storage-dotnet-how-to-use-files?tabs=dotnet
    125201-dotnetcode.txt

    Try to run the above code snippet in a loop sleeping for a particular time period
    Try to extend the code , get the timestamp and write the additional logic based upon your requirements after retrieving the timestamp

    When you run that code the output looks something like below:

    125139-image.png

    Let us know if you need additional help.

    Regards,
    Shiva.