Create a schedule

 

Updated: May 26, 2016

The Create a schedule task creates a schedule for a job to run, but it cannot run until it is linked to a runbook by using the Assoicate a runbook with a schedule operation.

The related Windows PowerShell cmdlet for this task is New-AzureRmAutomationSchedule.

To specify the request, replace {subscription-id} with your subscription ID, {resource-group-name} with the name of your resource group, {automation-account-name} with the name of the automation account, and {schedule-name} with the name of the schedule.

Method

Request URI

PUT

https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.Automation/automationAccounts/{automation-account-name}/schedules/{schedule-name}?api-version=2015-10-31

URI parameter

Description

api-version

Required. Valid values include 2015-10-31

The following code shows an example of the request body.

{
   "properties":{
      "description":"Run every other hour",
      "startTime":"2015-05-11T09:00:00",
      "expiryTime":"2016-05-22T09:00:00",
      "isEnabled":true,
      "interval":2,
      "frequency":"hour"
   }
}

Element name

Required

Type

Description

DayInterval

Yes

Byte

Specifies an interval, in days, for the schedule. The default value is one (1).

Description

No

String

Specifies a description for the schedule.

ExpiryTime

Yes

DateTimeOffset

Specifies the expiry time of a schedule as a DateTimeOffest object. You can specify a string that can be converted to a valid DateTimeOffset.

HourInterval

No

Byte

Specifies an interval, in hours, for the schedule.

Name

Yes

String

Specifies a name for the schedule.

StartTime

Yes

DateTimeOffset

Specifies the start time of a schedule as a DateTimeOffset object. You can specify a string that can be converted to a valid DateTimeOffset.

The following code shows an example of the response body.

{
   "name":"AuditSched",
   "properties":{
      "description":"Run every other hour",
      "startTime":"2015-05-11T09:00:00+00:00",
      "expiryTime":"2016-05-22T09:00:00+00:00",
      "isEnabled":true,
      "nextRun":"2015-05-11T09:00:00+00:00",
      "interval":2,
      "frequency":"Hour",
      "creationTime":"2015-05-03T21:28:21.02+00:00",
      "lastModifiedTime":"2015-05-03T21:28:21.02+00:00"
   }
}


201

For information about common error codes, see Service Management Status and Error Codes

Show: