Azure Monitor Action Rules Schedule

Cosmin Stirbu 156 Reputation points
2021-05-19T06:14:05.133+00:00

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
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,037 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. tbgangav-MSFT 10,421 Reputation points
    2021-05-21T09:36:35.54+00:00

    Hi @Cosmin Stirbu ,

    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