Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to specify a weekly recurring schedule for Global Schedules #4108

Open
3 of 9 tasks
KatteKwaad opened this issue Jan 23, 2024 · 0 comments
Open
3 of 9 tasks

Unable to specify a weekly recurring schedule for Global Schedules #4108

KatteKwaad opened this issue Jan 23, 2024 · 0 comments
Labels
customer-reported question Further information is requested

Comments

@KatteKwaad
Copy link

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

  • C#/.NET
  • Java
  • JavaScript/TypedScript
  • Python
  • Golang
  • Other - Please specify in Issue details field

Sample Issue Type

  • Sample not working
  • Sample missing
  • Do not understand sample

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:

PUT https://management.azure.com/subscriptions//resourceGroups//providers/Microsoft.DevTestLab/schedules/shutdown-computevm-mycoolvm?api-version=2018-09-15

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:

PUT https://management.azure.com/subscriptions//resourceGroups//providers/Microsoft.DevTestLab/schedules/shutdown-computevm-mycoolvm?api-version=2018-09-15

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

  1. follow the link to the MS documentation here:
  2. https://learn.microsoft.com/en-us/rest/api/dtl/global-schedules/create-or-update?view=rest-dtl-2018-09-15&tabs=HTTP#code-try-0
  3. Sign in with your Azure Account that has a valid subscription.
  4. Create a virtual machine
  5. 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":

{ "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

@microsoft-github-policy-service microsoft-github-policy-service bot added question Further information is requested customer-reported labels Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-reported question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant