How to disable a playbook from running during weekends?

Georgi Palazov 286 Reputation points
2023-01-28T15:56:44.13+00:00

Hello,

I have some simple playbooks which have the following flow:

Run every 30mins->run the query and list results->if count is 0 sent a message in teams channel.

Thing is we often get 0 during the weekends. How to disable this playbook from running during weekends?

I have the following query which lists only zeros during weekends - seems like it doesn't make much sense.

let Saturday = time(6.00:00:00);
let Sunday = time(0.00:00:00);
CAPAMAuditLog
| where TimeGenerated > ago(90m)
| where dayofweek(TimeGenerated) != Saturday
| where dayofweek(TimeGenerated) != Sunday
| count

User's image

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
2,867 questions
Microsoft Sentinel
Microsoft Sentinel
A scalable, cloud-native solution for security information event management and security orchestration automated response. Previously known as Azure Sentinel.
989 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,638 questions
0 comments No comments
{count} votes

Accepted answer
  1. Dillon Silzer 54,731 Reputation points
    2023-01-28T19:20:11.7933333+00:00

    Hello,

    Solution #1

    What you can do is Initialize Variable > set the Expression to dayOfWeek(utcNow()) > use this variable in a Condition and say if the variable you set is (6 or 7) do something otherwise perform your functions.

    User's image

    User's image

    The final result will look something like:

    User's image

    Solution #2

    Go to Recurrence and change to 1 Week > select all weekdays

    User's image

    Then choose At these hours

    User's image

    Then choose At these minutes as 00,30

    User's image


    If this is helpful please accept answer.

    0 comments No comments

0 additional answers

Sort by: Most helpful