Microsoft.DevTestLab labs/schedules

Bicep resource definition

The labs/schedules resource type can be deployed with operations that target:

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.DevTestLab/labs/schedules resource, add the following Bicep to your template.

resource symbolicname 'Microsoft.DevTestLab/labs/schedules@2018-09-15' = {
  parent: resourceSymbolicName
  location: 'string'
  name: 'string'
  properties: {
    dailyRecurrence: {
      time: 'string'
    }
    hourlyRecurrence: {
      minute: int
    }
    notificationSettings: {
      emailRecipient: 'string'
      notificationLocale: 'string'
      status: 'string'
      timeInMinutes: int
      webhookUrl: 'string'
    }
    status: 'string'
    targetResourceId: 'string'
    taskType: 'string'
    timeZoneId: 'string'
    weeklyRecurrence: {
      time: 'string'
      weekdays: [
        'string'
      ]
    }
  }
  tags: {
    {customized property}: 'string'
  }
}

Property Values

Microsoft.DevTestLab/labs/schedules

Name Description Value
location The geo-location where the resource lives string
name The resource name string (required)
parent In Bicep, you can specify the parent resource for a child resource. You only need to add this property when the child resource is declared outside of the parent resource.

For more information, see Child resource outside parent resource.
Symbolic name for resource of type: labs
properties The properties of the resource. ScheduleProperties (required)
tags Resource tags Dictionary of tag names and values. See Tags in templates

DayDetails

Name Description Value
time The time of day the schedule will occur. string

HourDetails

Name Description Value
minute Minutes of the hour the schedule will run. int

NotificationSettings

Name Description Value
emailRecipient The email recipient to send notifications to (can be a list of semi-colon separated email addresses). string
notificationLocale The locale to use when sending a notification (fallback for unsupported languages is EN). string
status If notifications are enabled for this schedule (i.e. Enabled, Disabled). 'Disabled'
'Enabled'
timeInMinutes Time in minutes before event at which notification will be sent. int
webhookUrl The webhook URL to which the notification will be sent. string

ScheduleProperties

Name Description Value
dailyRecurrence If the schedule will occur once each day of the week, specify the daily recurrence. DayDetails
hourlyRecurrence If the schedule will occur multiple times a day, specify the hourly recurrence. HourDetails
notificationSettings Notification settings. NotificationSettings
status The status of the schedule (i.e. Enabled, Disabled) 'Disabled'
'Enabled'
targetResourceId The resource ID to which the schedule belongs string
taskType The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). string
timeZoneId The time zone ID (e.g. China Standard Time, Greenland Standard Time, Pacific Standard time, etc.). The possible values for this property can be found in IReadOnlyCollection<string> TimeZoneConverter.TZConvert.KnownWindowsTimeZoneIds (https://github.com/mattjohnsonpint/TimeZoneConverter/blob/main/README.md) string
weeklyRecurrence If the schedule will occur only some days of the week, specify the weekly recurrence. WeekDetails

ScheduleTags

Name Description Value

WeekDetails

Name Description Value
time The time of the day the schedule will occur. string
weekdays The days of the week for which the schedule is set (e.g. Sunday, Monday, Tuesday, etc.). string[]

Usage Examples

Bicep Samples

A basic example of deploying automated startup and shutdown schedules for Azure Dev Test Lab.

param resourceName string = 'acctest0001'
param location string = 'westeurope'

resource lab 'Microsoft.DevTestLab/labs@2018-09-15' = {
  name: resourceName
  location: location
  properties: {
    labStorageType: 'Premium'
  }
}

resource schedule 'Microsoft.DevTestLab/labs/schedules@2018-09-15' = {
  name: 'LabVmsShutdown'
  location: location
  parent: lab
  properties: {
    dailyRecurrence: {
      time: '0100'
    }
    notificationSettings: {
      status: 'Disabled'
      timeInMinutes: 0
      webhookUrl: ''
    }
    status: 'Disabled'
    taskType: 'LabVmsShutdownTask'
    timeZoneId: 'India Standard Time'
  }
  tags: {
    environment: 'Production'
  }
}

ARM template resource definition

The labs/schedules resource type can be deployed with operations that target:

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.DevTestLab/labs/schedules resource, add the following JSON to your template.

{
  "type": "Microsoft.DevTestLab/labs/schedules",
  "apiVersion": "2018-09-15",
  "name": "string",
  "location": "string",
  "properties": {
    "dailyRecurrence": {
      "time": "string"
    },
    "hourlyRecurrence": {
      "minute": "int"
    },
    "notificationSettings": {
      "emailRecipient": "string",
      "notificationLocale": "string",
      "status": "string",
      "timeInMinutes": "int",
      "webhookUrl": "string"
    },
    "status": "string",
    "targetResourceId": "string",
    "taskType": "string",
    "timeZoneId": "string",
    "weeklyRecurrence": {
      "time": "string",
      "weekdays": [ "string" ]
    }
  },
  "tags": {
    "{customized property}": "string"
  }
}

Property Values

Microsoft.DevTestLab/labs/schedules

Name Description Value
apiVersion The api version '2018-09-15'
location The geo-location where the resource lives string
name The resource name string (required)
properties The properties of the resource. ScheduleProperties (required)
tags Resource tags Dictionary of tag names and values. See Tags in templates
type The resource type 'Microsoft.DevTestLab/labs/schedules'

DayDetails

Name Description Value
time The time of day the schedule will occur. string

HourDetails

Name Description Value
minute Minutes of the hour the schedule will run. int

NotificationSettings

Name Description Value
emailRecipient The email recipient to send notifications to (can be a list of semi-colon separated email addresses). string
notificationLocale The locale to use when sending a notification (fallback for unsupported languages is EN). string
status If notifications are enabled for this schedule (i.e. Enabled, Disabled). 'Disabled'
'Enabled'
timeInMinutes Time in minutes before event at which notification will be sent. int
webhookUrl The webhook URL to which the notification will be sent. string

ScheduleProperties

Name Description Value
dailyRecurrence If the schedule will occur once each day of the week, specify the daily recurrence. DayDetails
hourlyRecurrence If the schedule will occur multiple times a day, specify the hourly recurrence. HourDetails
notificationSettings Notification settings. NotificationSettings
status The status of the schedule (i.e. Enabled, Disabled) 'Disabled'
'Enabled'
targetResourceId The resource ID to which the schedule belongs string
taskType The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). string
timeZoneId The time zone ID (e.g. China Standard Time, Greenland Standard Time, Pacific Standard time, etc.). The possible values for this property can be found in IReadOnlyCollection<string> TimeZoneConverter.TZConvert.KnownWindowsTimeZoneIds (https://github.com/mattjohnsonpint/TimeZoneConverter/blob/main/README.md) string
weeklyRecurrence If the schedule will occur only some days of the week, specify the weekly recurrence. WeekDetails

ScheduleTags

Name Description Value

WeekDetails

Name Description Value
time The time of the day the schedule will occur. string
weekdays The days of the week for which the schedule is set (e.g. Sunday, Monday, Tuesday, etc.). string[]

Usage Examples

Terraform (AzAPI provider) resource definition

The labs/schedules resource type can be deployed with operations that target:

  • Resource groups

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.DevTestLab/labs/schedules resource, add the following Terraform to your template.

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.DevTestLab/labs/schedules@2018-09-15"
  name = "string"
  parent_id = "string"
  location = "string"
  tags = {
    {customized property} = "string"
  }
  body = {
    properties = {
      dailyRecurrence = {
        time = "string"
      }
      hourlyRecurrence = {
        minute = int
      }
      notificationSettings = {
        emailRecipient = "string"
        notificationLocale = "string"
        status = "string"
        timeInMinutes = int
        webhookUrl = "string"
      }
      status = "string"
      targetResourceId = "string"
      taskType = "string"
      timeZoneId = "string"
      weeklyRecurrence = {
        time = "string"
        weekdays = [
          "string"
        ]
      }
    }
  }
}

Property Values

Microsoft.DevTestLab/labs/schedules

Name Description Value
location The geo-location where the resource lives string
name The resource name string (required)
parent_id The ID of the resource that is the parent for this resource. ID for resource of type: labs
properties The properties of the resource. ScheduleProperties (required)
tags Resource tags Dictionary of tag names and values.
type The resource type "Microsoft.DevTestLab/labs/schedules@2018-09-15"

DayDetails

Name Description Value
time The time of day the schedule will occur. string

HourDetails

Name Description Value
minute Minutes of the hour the schedule will run. int

NotificationSettings

Name Description Value
emailRecipient The email recipient to send notifications to (can be a list of semi-colon separated email addresses). string
notificationLocale The locale to use when sending a notification (fallback for unsupported languages is EN). string
status If notifications are enabled for this schedule (i.e. Enabled, Disabled). 'Disabled'
'Enabled'
timeInMinutes Time in minutes before event at which notification will be sent. int
webhookUrl The webhook URL to which the notification will be sent. string

ScheduleProperties

Name Description Value
dailyRecurrence If the schedule will occur once each day of the week, specify the daily recurrence. DayDetails
hourlyRecurrence If the schedule will occur multiple times a day, specify the hourly recurrence. HourDetails
notificationSettings Notification settings. NotificationSettings
status The status of the schedule (i.e. Enabled, Disabled) 'Disabled'
'Enabled'
targetResourceId The resource ID to which the schedule belongs string
taskType The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). string
timeZoneId The time zone ID (e.g. China Standard Time, Greenland Standard Time, Pacific Standard time, etc.). The possible values for this property can be found in IReadOnlyCollection<string> TimeZoneConverter.TZConvert.KnownWindowsTimeZoneIds (https://github.com/mattjohnsonpint/TimeZoneConverter/blob/main/README.md) string
weeklyRecurrence If the schedule will occur only some days of the week, specify the weekly recurrence. WeekDetails

ScheduleTags

Name Description Value

WeekDetails

Name Description Value
time The time of the day the schedule will occur. string
weekdays The days of the week for which the schedule is set (e.g. Sunday, Monday, Tuesday, etc.). string[]

Usage Examples

Terraform Samples

A basic example of deploying automated startup and shutdown schedules for Azure Dev Test Lab.

terraform {
  required_providers {
    azapi = {
      source = "Azure/azapi"
    }
  }
}

provider "azapi" {
  skip_provider_registration = false
}

variable "resource_name" {
  type    = string
  default = "acctest0001"
}

variable "location" {
  type    = string
  default = "westeurope"
}

resource "azapi_resource" "resourceGroup" {
  type     = "Microsoft.Resources/resourceGroups@2020-06-01"
  name     = var.resource_name
  location = var.location
}

resource "azapi_resource" "lab" {
  type      = "Microsoft.DevTestLab/labs@2018-09-15"
  parent_id = azapi_resource.resourceGroup.id
  name      = var.resource_name
  location  = var.location
  body = {
    properties = {
      labStorageType = "Premium"
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}

resource "azapi_resource" "schedule" {
  type      = "Microsoft.DevTestLab/labs/schedules@2018-09-15"
  parent_id = azapi_resource.lab.id
  name      = "LabVmsShutdown"
  location  = var.location
  body = {
    properties = {
      dailyRecurrence = {
        time = "0100"
      }
      notificationSettings = {
        status        = "Disabled"
        timeInMinutes = 0
        webhookUrl    = ""
      }
      status     = "Disabled"
      taskType   = "LabVmsShutdownTask"
      timeZoneId = "India Standard Time"
    }
    tags = {
      environment = "Production"
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}