I’m trying to use Azure Logic App to create an automation that sets the number of always ready instances to 1 during weekends and back to 3 during working days.
Note that my function app is hosted in an Elastic Premium Plan EP1.
I have been struggling on this task but at the end I was not able to solve it. Also I didn’t find any documentation for creating this automation.
Do you have any idea if it is possible to do this?
2
Answers
For the sake of completeness, in the following, a configuration that sets the number of always ready instances to 3 during business hours of week days, and 1 always ready instance during weekend days and out of business hours:
After reproducing from my end, I could get this done using Azure Automation Account. I have set the days that I wanted in Logic Apps and made a call to execute the below script based on the day.
First of all navigate to the "Automation Accounts" service from the console, if you don’t have any automation accounts yet, create one pressing the button "create":
Then you create two runbooks under "Process Automation" section:
Using this PowerShell scripts:
runbook1 script for Weekdays
runbook2 script for Weekends
Don’t forget to "save" and then "publish" the runbooks.
Then navigate to Logic apps service from the console and create a new instance, then go to "logic apps designer".
Here is the flow of my logic app:
In the True and False boxes search for "create job":
Note that when you create the job, you will need to authenticate using one of the available authentication metodologies, I have selected "OAuth default", then you simply paste the tenantID of your subscription.
Results: