2015. május 15., péntek

Set-AzureAutomationSchedule is bugged - "The start time of the schedule must be at least 5 minutes"...

We host our development servers in the cloud, and to save serious  bucks, they only run during office hours (50 hours a week out of the the 168, thats a nifty 70% saving).

There are two azure automation tasks, one shuts down the computers every evening, and another starts them up half an hour before anyone gets to the office.

However, overtime happens, so there is also a script that each developer can run that delays the evening shutdown with a couple of hours. This basicly disabled the evening shutdown Automation Schedule, and the morning startup script turns it back on.

This is the theory.

In practice, Set-AzureAutomationSchedule is a piece of crap and doesn't work half the time. When I try to set the status of a perfectly valid schedule, I encounter the following error message;



Mind you, the script works on the first day when you create the schedule, only later does it stop working.

The workaround is simple; instead of enabling and disabling the schedule, I simply drop and recreate it.