Forum Discussion

arwadhahri's avatar
arwadhahri
Copper Contributor
Oct 15, 2024

How can I make an Azure Logic App only execute during a certain window of time?

 

I have a logic app that retrieves all security incidents from Microsoft Sentinel and sends them to a Teams channel. Notifications in Microsoft Teams are always received between 9 PM and 5 AM. I want to configure the logic app in Microsoft Azure so that it sends incidents only within the time range of 7 AM to 5 PM, and only on working days, from Monday to Friday.

i used Recurrence trigger itself. As shown below I have it for every 15 minutes on Monday to Friday between 7 am to 5 pm.

 

 

Even, i tryed to put the récurrence trigger in défirent position in my logic app , but the same error 

 

 


 

  • arwadhahri 

     

    The error message you're seeing (WorkflowRunActionTypeUnSupported) indicates that there is a problem with the Recurrence trigger in your Logic App. This error typically occurs when the Recurrence trigger is not placed correctly or used in a way that is unsupported.

     

    Please try these steps.

    1. Ensure Recurrence is the First Step:

    The Recurrence trigger must be the first step in your Logic App. Double-check that it's at the very beginning.


    2. Use the Right Recurrence Trigger:

    In your Logic App designer, search for "Recurrence" under the Schedule section and add it as the trigger. Do not use Recurrence as an action later in the workflow.


    3. Delete and Re-add the Recurrence Trigger:

    If the issue continues, delete the current trigger and add it again from the Schedule section.

  • arwadhahri 

     

    The error message you're seeing (WorkflowRunActionTypeUnSupported) indicates that there is a problem with the Recurrence trigger in your Logic App. This error typically occurs when the Recurrence trigger is not placed correctly or used in a way that is unsupported.

     

    Please try these steps.

    1. Ensure Recurrence is the First Step:

    The Recurrence trigger must be the first step in your Logic App. Double-check that it's at the very beginning.


    2. Use the Right Recurrence Trigger:

    In your Logic App designer, search for "Recurrence" under the Schedule section and add it as the trigger. Do not use Recurrence as an action later in the workflow.


    3. Delete and Re-add the Recurrence Trigger:

    If the issue continues, delete the current trigger and add it again from the Schedule section.

  • arwadhahri 

     

    You may consider setup Recurrence Trigger with condition to check the time, sending notification may refer below as sample:

     

    {
    "definition": {
    "triggers": {
    "Recurrence": {
    "recurrence": {
    "frequency": "Minute",
    "interval": 15,
    "startTime": "2024-10-16T07:00:00Z",
    "endTime": "2024-10-16T17:00:00Z",
    "timeZone": "UTC",
    "weekDays": [
    "Monday",
    "Tuesday",
    "Wednesday",
    "Thursday",
    "Friday"
    ]
    }
    }
    },
    "actions": {
    "Condition": {
    "actions": {
    "If_true": {
    "actions": {
    "Get_Incidents": {
    "type": "ApiConnection",
    "inputs": {
    "method": "get",
    "path": "/incidents",
    "authentication": {
    "type": "ManagedServiceIdentity"
    }
    }
    },
    "Send_to_Teams": {
    "type": "ApiConnection",
    "inputs": {
    "method": "post",
    "path": "/messages",
    "authentication": {
    "type": "ManagedServiceIdentity"
    },
    "body": {
    "content": "@{body('Get_Incidents')}"
    }
    }
    }
    }
    }
    },
    "expression": "@and(greaterOrEquals(formatDateTime(utcNow(), 'HH'), '07'), lessOrEquals(formatDateTime(utcNow(), 'HH'), '17'))"
    }
    }
    }
    }

Resources