If I want to deploy a monthly schedule on for example the last day of the month I encounter an error message when I used the REST API or the ARM template.
The body of the REST API for creating schedules I used look likes this:
{ "name": "demoSchedule", "properties": { "startTime": "2022-05-07T22:00:00+02:00", "interval": 1, "frequency": "Month", "advancedSchedule": { "weekDays": [], "monthDays": [ -1 ], "monthlyOccurrences": [] } } }
When I execute this REST call I receive the following error message:
{ "code": "BadRequest", "message": "Argument requestScheduleData with value Orchestrator.Schedules.DataAccess.Models.ScheduleAllData is not valid. Error message: The input value is not valid for Monthly Schedule Type" }
After spending a lot of time of trial & error I learned that when I update an existing schedule the action can be completed successfully. So if I first post the following body to the REST API the schedule will be created successfully.
{ "name": "demoSchedule", "properties": { "startTime": "2022-05-07T22:00:00+02:00", "interval": 1, "frequency": "Week", "advancedSchedule": { "weekDays": [ "Friday" ], "monthDays": [], "monthlyOccurrences": [] } } }
In the second step I will sent the body of the call that fails and the schedule will be updated successfully. I tested apiVersion 2015-10-31 and 2020-01-13-preview and both will fail if you want to create the new schedule with one call.
Comments
Post a Comment