azureloggingduplicatesactivitylog

Why does Azure activity logs repeats the logs for a resource after it succeeded?


I am writing a script that checks the activity logs from Azure every 2 minutes into a DB. If an action is performed my script most of the time picks up the log due to the lag between the actual event and the time it was logged.

After the action has been marked as Succeeded, Azure logs again the same action as Succeeded with the same keys and values except for the timestamps and the ID of the log. Is there anyway to go around this from Azure perspective? I don't want to have to check the DB to see if that action was already executed and added to the database and have duplicates.

Thank you!


Solution

  • I was not able to find why Azure logs a succeeded action again after 10 minutes, but I wrote my script to run every 90 seconds and add the succeeded action to a database. When the second succeeded action gets logged and my script picks it up, I check the database to see if it was already added. If it was, then I just skip it.