You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently it doesn't seem possible to specify a Global Schedule with a weekly recurrence. Daily works fine, but providing the weekly recurrence details results in an HTTP400 response that mentions the daily recurrence is missing.
Sample that produces the error:
{ "error": { "code": "ConflictingProperties", "message": "Input only one of the properties among [WeeklyRecurrence, DailyRecurrence, HourlyRecurrence]. Entering more than one will cause a conflict." } }
I can confirm that it works if you wish to specify only a daily schedule but there is no way that I can get it to add a weekly schedule
Expected behavior
I would expect an HTTP 201 or 200 with a sample response similar to the example in the documentation:
Sign in with your Azure Account that has a valid subscription.
Create a virtual machine
Fill in the request required form details and provide a request body that specifies a weekly recurrence schedule. Be sure to set taskType as a "ComputeVmShutdownTask":
Link to sample
https://learn.microsoft.com/en-us/rest/api/dtl/global-schedules/create-or-update?view=rest-dtl-2018-09-15&tabs=HTTP
Library name and version
Rest API (management.azure.com) 2018-09-15
Language of the Sample
Sample Issue Type
Issue details
Currently it doesn't seem possible to specify a Global Schedule with a weekly recurrence. Daily works fine, but providing the weekly recurrence details results in an HTTP400 response that mentions the daily recurrence is missing.
Sample that produces the error:
body:
{ "location": "canadacentral", "properties": { "status": "Enabled", "timeZoneId": "Hawaiian Standard Time", "taskType": "ComputeVmShutdownTask", "targetResourceId": "/subscriptions/<REDACTED SUB>/resourceGroups/<REDACTED RG>/providers/Microsoft.Compute/virtualMachines/mycoolvm", "weeklyRecurrence": { "time": "0700", "weekdays": [ "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ] } } }
The response
{ "error": { "code": "MissingRequiredProperty", "message": "Missing required property 'DailyRecurrence'." } }
even if you specify the properties.dailyRecurrence value as such:
body:
{ "location": "canadacentral", "properties": { "status": "Enabled", "timeZoneId": "Hawaiian Standard Time", "taskType": "ComputeVmShutdownTask", "targetResourceId": "/subscriptions/<REDACTED SUB>/resourceGroups/<REDACTED RG>/providers/Microsoft.Compute/virtualMachines/mycoolvm", "dailyRecurrence": { "time": "0700" }, "weeklyRecurrence": { "time": "0700", "weekdays": [ "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ] } } }
The following HTTP 400 is returned:
{ "error": { "code": "ConflictingProperties", "message": "Input only one of the properties among [WeeklyRecurrence, DailyRecurrence, HourlyRecurrence]. Entering more than one will cause a conflict." } }
I can confirm that it works if you wish to specify only a daily schedule but there is no way that I can get it to add a weekly schedule
Expected behavior
I would expect an HTTP 201 or 200 with a sample response similar to the example in the documentation:
{ "properties": { "status": "Enabled", "taskType": "ComputeVmShutdownTask", "weeklyRecurrence": { "weekdays": [ "Monday", "Tuesday", "Wednesday", "Thursday", "Friday" ], "time": "0700" }, "timeZoneId": "Hawaiian Standard Time", "notificationSettings": { "status": "Disabled", "timeInMinutes": 0 }, "createdDate": "2020-12-29T22:54:54.9335182+00:00", "provisioningState": "Succeeded", "uniqueIdentifier": "{id}" }, "id": "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/schedules/labvmautostart", "name": "LabVmAutoStart", "type": "microsoft.devtestlab/labs/schedules", "location": "{location}", "tags": { "tagName1": "tagValue1" } }
Actual behavior
An HTTP 400 is returned when only a weekly recurrence is specified:
{ "error": { "code": "MissingRequiredProperty", "message": "Missing required property 'DailyRecurrence'." } }
Reproduction Steps
{ "location": "canadacentral", "properties": { "status": "Enabled", "timeZoneId": "Hawaiian Standard Time", "taskType": "ComputeVmShutdownTask", "targetResourceId": "/subscriptions/<REDACTED SUB>/resourceGroups/<REDACTED RG>/providers/Microsoft.Compute/virtualMachines/mycoolvm", "dailyRecurrence": { "time": "0700" }, "weeklyRecurrence": { "time": "0700", "weekdays": [ "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ] } } }
Environment
No response
The text was updated successfully, but these errors were encountered: