Microsoft.DevTestLab labs/schedules 2015-05-21-preview

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@2015-05-21-preview' = {
  parent: resourceSymbolicName
  location: 'string'
  name: 'string'
  properties: {
    dailyRecurrence: {
      time: 'string'
    }
    hourlyRecurrence: {
      minute: int
    }
    provisioningState: 'string'
    status: '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 location of the resource. 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
tags Resource tags Dictionary of tag names and values. See Tags in templates

DayDetails

Name Description Value
time string

HourDetails

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

ScheduleProperties

Name Description Value
dailyRecurrence The daily recurrence of the schedule. DayDetails
hourlyRecurrence The hourly recurrence of the schedule. HourDetails
provisioningState The provisioning status of the resource. string
status The status of the schedule. 'Disabled'
'Enabled'
taskType The task type of the schedule. 'LabBillingTask'
'LabVmsShutdownTask'
'LabVmsStartupTask'
timeZoneId The time zone id. string
weeklyRecurrence The weekly recurrence of the schedule. WeekDetails

ScheduleTags

Name Description Value

WeekDetails

Name Description Value
time The time of the day. string
weekdays The days of the week. 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": "2015-05-21-preview",
  "name": "string",
  "location": "string",
  "properties": {
    "dailyRecurrence": {
      "time": "string"
    },
    "hourlyRecurrence": {
      "minute": "int"
    },
    "provisioningState": "string",
    "status": "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 '2015-05-21-preview'
location The location of the resource. string
name The resource name string (required)
properties The properties of the resource. ScheduleProperties
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 string

HourDetails

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

ScheduleProperties

Name Description Value
dailyRecurrence The daily recurrence of the schedule. DayDetails
hourlyRecurrence The hourly recurrence of the schedule. HourDetails
provisioningState The provisioning status of the resource. string
status The status of the schedule. 'Disabled'
'Enabled'
taskType The task type of the schedule. 'LabBillingTask'
'LabVmsShutdownTask'
'LabVmsStartupTask'
timeZoneId The time zone id. string
weeklyRecurrence The weekly recurrence of the schedule. WeekDetails

ScheduleTags

Name Description Value

WeekDetails

Name Description Value
time The time of the day. string
weekdays The days of the week. 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@2015-05-21-preview"
  name = "string"
  parent_id = "string"
  location = "string"
  tags = {
    {customized property} = "string"
  }
  body = {
    properties = {
      dailyRecurrence = {
        time = "string"
      }
      hourlyRecurrence = {
        minute = int
      }
      provisioningState = "string"
      status = "string"
      taskType = "string"
      timeZoneId = "string"
      weeklyRecurrence = {
        time = "string"
        weekdays = [
          "string"
        ]
      }
    }
  }
}

Property Values

Microsoft.DevTestLab/labs/schedules

Name Description Value
location The location of the resource. 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
tags Resource tags Dictionary of tag names and values.
type The resource type "Microsoft.DevTestLab/labs/schedules@2015-05-21-preview"

DayDetails

Name Description Value
time string

HourDetails

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

ScheduleProperties

Name Description Value
dailyRecurrence The daily recurrence of the schedule. DayDetails
hourlyRecurrence The hourly recurrence of the schedule. HourDetails
provisioningState The provisioning status of the resource. string
status The status of the schedule. 'Disabled'
'Enabled'
taskType The task type of the schedule. 'LabBillingTask'
'LabVmsShutdownTask'
'LabVmsStartupTask'
timeZoneId The time zone id. string
weeklyRecurrence The weekly recurrence of the schedule. WeekDetails

ScheduleTags

Name Description Value

WeekDetails

Name Description Value
time The time of the day. string
weekdays The days of the week. 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    = ["*"]
}