Azure Logic App schedule query

mij2020 376 Reputation points
2022-06-07T14:32:17.063+00:00

Hi,
I'd like to schedule a trigger for a logic app to run every day except the start and end of each month.

Would the following code work for this purpose:

"Recurrence": {
"evaluatedRecurrence": {
"frequency": "Month",
"interval": 1,
"schedule": {
"hours": [
"23"
],
"minutes": [
59
],
"monthDays": [
"2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24,"25","26","27"
]
},
"startTime": "2022-06-07T22:00:00",
"timeZone": "GMT Standard Time"
},

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,542 questions
0 comments No comments
{count} votes

Accepted answer
  1. MayankBargali-MSFT 70,936 Reputation points Moderator
    2022-06-08T03:20:31.53+00:00

    @mij2020 Thanks for reaching out. As per your business requirement as you want to run your workflow every day expect the start and end of each month then you should also write the condition to validate if date is first or last day of every month.

    In the below screenshot I am triggering my logic app every day and my next action validate whether the date is first or last of the month. If it is not the first or last of the month then the condition will be True and my true workflow will get executed. You need to write all the next action in the True condition as per your business needs.

    For your reference, please refer to the Code View.

    209270-image.png

    **Expression to check if it is the first day of the month: **
    int(dayOfMonth(utcNow())) == 1

    **Expression to check if it is the last day of the month: **
    int(dayOfMonth(utcNow())) == int(formatDateTime(subtractFromTime(startOfMonth(addToTime(utcNow(),1,'month')),1,'day'),'dd'))

    To learn more about the different function expressions supported in logic app you can refer to this document.

    **Note: ** All the datetime are in UTC and if you want in your local time then change the time zone in your trigger and condition as per your need. The above is only for reference and please test it before using it in your production environment.

    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.