question

CosminStirbu-1831 avatar image
0 Votes"
CosminStirbu-1831 asked CosminStirbu-1831 commented

Azure Monitor Action Rules Schedule

Hello,

I am looking into suppressing an alert the following way:


  • Monday, Tuesday, Wednesday, Thursday, Friday it should be suppressed before 07:00 UTC and after 19:00 UTC.

  • Saturday, Sunday it should be suppressed before 09:00 UTC and after 17:00 UTC.


The way I am trying to achieve this is via two separate action rules with the following schedule (Terraform snippet):

   suppression {
     recurrence_type = "Weekly"
    
     schedule {
       start_date_utc    = "2021-01-01T19:00:00Z"
       end_date_utc      = "2026-01-01T07:00:00Z"
       recurrence_weekly = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"]
     }
   }

   suppression {
     recurrence_type = "Weekly"
    
     schedule {
       start_date_utc    = "2021-01-01T17:00:00Z"
       end_date_utc      = "2026-01-01T09:00:00Z"
       recurrence_weekly = ["Saturday", "Sunday"]
     }
   }

As you'll notice the start time is 19:00 / 17:00 UTC and the end time is 07:00 / 09:00 UTC. I am doing this to avoid creating 4 rules, two for the start of day (e.g. 00:00 - 07:00 / 00:00 - 09:00 and 19:00 - 23:59 / 17:00 - 23:59) however I am not completely sure (and it's rather difficult to test) that this will work as expected.


The alternative with the 4 rules would look as follows:

   suppression {
     recurrence_type = "Weekly"
    
     schedule {
       start_date_utc    = "2021-01-01T00:00:00Z"
       end_date_utc      = "2026-01-01T07:00:00Z"
       recurrence_weekly = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"]
     }
   }
    
   suppression {
     recurrence_type = "Weekly"
    
     schedule {
       start_date_utc    = "2021-01-01T19:00:00Z"
       end_date_utc      = "2026-01-01T23:59:59Z"
       recurrence_weekly = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"]
     }
   }
    
   suppression {
     recurrence_type = "Weekly"
    
     schedule {
       start_date_utc    = "2021-01-01T00:00:00Z"
       end_date_utc      = "2026-01-01T09:00:00Z"
       recurrence_weekly = ["Saturday", "Sunday"]
     }
   }
    
   suppression {
     recurrence_type = "Weekly"
    
     schedule {
       start_date_utc    = "2021-01-01T17:00:00Z"
       end_date_utc      = "2026-01-01T23:59:59Z"
       recurrence_weekly = ["Saturday", "Sunday"]
     }
   }

Any help with this question is appreciated.

Thank you,
Cosmin






azure-monitor
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

tbgangav-MSFT avatar image
0 Votes"
tbgangav-MSFT answered CosminStirbu-1831 commented

Hi @CosminStirbu-1831,

AFAIK it should work as expected w.r.t this Azure Action Rules preview feature as the hyperlinked official documentation mentions that it suppresses notifications within a bounded duration. For reference, you may check below documentation screenshot as well.

However, as this feature is currently in preview state so I will check internally if there might be an issue for such longer duration schedule (i.e., 5 years in this case) and will update you at the earliest possible.

Also just FYI, as the testing is using Terraform Azure provider (azurerm_monitor_action_rule_suppression) so going forward if you face any issue or error in the Terraform level then I would recommend you to ask the question in Terraform Azure Provider Community Forum.

Documentation screenshot:
98591-image.png

Portal screenshot:
98562-actionrulesuppression.png



image.png (157.4 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @tbgangav-MSFT ,

Thank you for your response.

I'm more concerned on how the 7:00 PM / 7:00 AM time interval (that is set for Friday) impacts the 5:00 PM / 9:00 AM time interval (that is set for Saturday).
Similarly for Sunday and Monday as well.

For now, just to eliminate any uncertainty, I went ahead with the approach based on 4 rules instead of 2, and it works as expected.

Thanks,
Cosmin

1 Vote 1 ·