Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Bicep resource definition
The labs/schedules resource type can be deployed with operations that target:
- Resource groups - See resource group deployment commands
For a list of changed properties in each API version, see change log.
Resource format
To create a Microsoft.LabServices/labs/schedules resource, add the following Bicep to your template.
resource symbolicname 'Microsoft.LabServices/labs/schedules@2023-06-07' = {
parent: resourceSymbolicName
name: 'string'
properties: {
notes: 'string'
recurrencePattern: {
expirationDate: 'string'
frequency: 'string'
interval: int
weekDays: [
'string'
]
}
startAt: 'string'
stopAt: 'string'
timeZoneId: 'string'
}
}
Property Values
Microsoft.LabServices/labs/schedules
| Name | Description | Value |
|---|---|---|
| name | The resource name | string Constraints: Min length = 1 Max length = 100 Pattern = ^[-\w\\._\\(\\)]+$ (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 | Schedule resource properties | ScheduleProperties (required) |
RecurrencePattern
| Name | Description | Value |
|---|---|---|
| expirationDate | When the recurrence will expire. This date is inclusive. | string (required) |
| frequency | The frequency of the recurrence. | 'Daily' 'Weekly' (required) |
| interval | The interval to invoke the schedule on. For example, interval = 2 and RecurrenceFrequency.Daily will run every 2 days. When no interval is supplied, an interval of 1 is used. | int Constraints: Min value = 1 Max value = 365 |
| weekDays | The week days the schedule runs. Used for when the Frequency is set to Weekly. | String array containing any of: 'Friday' 'Monday' 'Saturday' 'Sunday' 'Thursday' 'Tuesday' 'Wednesday' |
ScheduleProperties
| Name | Description | Value |
|---|---|---|
| notes | Notes for this schedule. | string Constraints: Max length = 1000 |
| recurrencePattern | The recurrence pattern of the scheduled actions. | RecurrencePattern |
| startAt | When lab user virtual machines will be started. Timestamp offsets will be ignored and timeZoneId is used instead. | string |
| stopAt | When lab user virtual machines will be stopped. Timestamp offsets will be ignored and timeZoneId is used instead. | string |
| timeZoneId | The IANA timezone id for the schedule. | string Constraints: Max length = 50 |
Usage Examples
Bicep Samples
A basic example of deploying Lab Services Labs Schedules.
param resourceName string = 'acctest0001'
param location string = 'westeurope'
@secure()
@description('The administrator password for the lab virtual machine')
param adminPassword string
resource lab 'Microsoft.LabServices/labs@2022-08-01' = {
name: resourceName
location: location
properties: {
autoShutdownProfile: {
shutdownOnDisconnect: 'Disabled'
shutdownOnIdle: 'None'
shutdownWhenNotConnected: 'Disabled'
}
connectionProfile: {
clientRdpAccess: 'None'
clientSshAccess: 'None'
webRdpAccess: 'None'
webSshAccess: 'None'
}
securityProfile: {
openAccess: 'Disabled'
}
title: 'Test Title'
virtualMachineProfile: {
additionalCapabilities: {
installGpuDrivers: 'Disabled'
}
adminUser: {
password: null
username: 'testadmin'
}
createOption: 'Image'
imageReference: {
offer: '0001-com-ubuntu-server-focal'
publisher: 'canonical'
sku: '20_04-lts'
version: 'latest'
}
sku: {
capacity: 1
name: 'Classic_Fsv2_2_4GB_128_S_SSD'
}
usageQuota: 'PT0S'
useSharedPassword: 'Disabled'
}
}
}
resource schedule 'Microsoft.LabServices/labs/schedules@2022-08-01' = {
parent: lab
name: resourceName
properties: {
stopAt: '2023-06-30T04:33:55Z'
timeZoneId: 'America/Los_Angeles'
}
}
ARM template resource definition
The labs/schedules resource type can be deployed with operations that target:
- Resource groups - See resource group deployment commands
For a list of changed properties in each API version, see change log.
Resource format
To create a Microsoft.LabServices/labs/schedules resource, add the following JSON to your template.
{
"type": "Microsoft.LabServices/labs/schedules",
"apiVersion": "2023-06-07",
"name": "string",
"properties": {
"notes": "string",
"recurrencePattern": {
"expirationDate": "string",
"frequency": "string",
"interval": "int",
"weekDays": [ "string" ]
},
"startAt": "string",
"stopAt": "string",
"timeZoneId": "string"
}
}
Property Values
Microsoft.LabServices/labs/schedules
| Name | Description | Value |
|---|---|---|
| apiVersion | The api version | '2023-06-07' |
| name | The resource name | string Constraints: Min length = 1 Max length = 100 Pattern = ^[-\w\\._\\(\\)]+$ (required) |
| properties | Schedule resource properties | ScheduleProperties (required) |
| type | The resource type | 'Microsoft.LabServices/labs/schedules' |
RecurrencePattern
| Name | Description | Value |
|---|---|---|
| expirationDate | When the recurrence will expire. This date is inclusive. | string (required) |
| frequency | The frequency of the recurrence. | 'Daily' 'Weekly' (required) |
| interval | The interval to invoke the schedule on. For example, interval = 2 and RecurrenceFrequency.Daily will run every 2 days. When no interval is supplied, an interval of 1 is used. | int Constraints: Min value = 1 Max value = 365 |
| weekDays | The week days the schedule runs. Used for when the Frequency is set to Weekly. | String array containing any of: 'Friday' 'Monday' 'Saturday' 'Sunday' 'Thursday' 'Tuesday' 'Wednesday' |
ScheduleProperties
| Name | Description | Value |
|---|---|---|
| notes | Notes for this schedule. | string Constraints: Max length = 1000 |
| recurrencePattern | The recurrence pattern of the scheduled actions. | RecurrencePattern |
| startAt | When lab user virtual machines will be started. Timestamp offsets will be ignored and timeZoneId is used instead. | string |
| stopAt | When lab user virtual machines will be stopped. Timestamp offsets will be ignored and timeZoneId is used instead. | string |
| timeZoneId | The IANA timezone id for the schedule. | string Constraints: Max length = 50 |
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.LabServices/labs/schedules resource, add the following Terraform to your template.
resource "azapi_resource" "symbolicname" {
type = "Microsoft.LabServices/labs/schedules@2023-06-07"
name = "string"
parent_id = "string"
body = {
properties = {
notes = "string"
recurrencePattern = {
expirationDate = "string"
frequency = "string"
interval = int
weekDays = [
"string"
]
}
startAt = "string"
stopAt = "string"
timeZoneId = "string"
}
}
}
Property Values
Microsoft.LabServices/labs/schedules
| Name | Description | Value |
|---|---|---|
| name | The resource name | string Constraints: Min length = 1 Max length = 100 Pattern = ^[-\w\\._\\(\\)]+$ (required) |
| parent_id | The ID of the resource that is the parent for this resource. | ID for resource of type: labs |
| properties | Schedule resource properties | ScheduleProperties (required) |
| type | The resource type | "Microsoft.LabServices/labs/schedules@2023-06-07" |
RecurrencePattern
| Name | Description | Value |
|---|---|---|
| expirationDate | When the recurrence will expire. This date is inclusive. | string (required) |
| frequency | The frequency of the recurrence. | 'Daily' 'Weekly' (required) |
| interval | The interval to invoke the schedule on. For example, interval = 2 and RecurrenceFrequency.Daily will run every 2 days. When no interval is supplied, an interval of 1 is used. | int Constraints: Min value = 1 Max value = 365 |
| weekDays | The week days the schedule runs. Used for when the Frequency is set to Weekly. | String array containing any of: 'Friday' 'Monday' 'Saturday' 'Sunday' 'Thursday' 'Tuesday' 'Wednesday' |
ScheduleProperties
| Name | Description | Value |
|---|---|---|
| notes | Notes for this schedule. | string Constraints: Max length = 1000 |
| recurrencePattern | The recurrence pattern of the scheduled actions. | RecurrencePattern |
| startAt | When lab user virtual machines will be started. Timestamp offsets will be ignored and timeZoneId is used instead. | string |
| stopAt | When lab user virtual machines will be stopped. Timestamp offsets will be ignored and timeZoneId is used instead. | string |
| timeZoneId | The IANA timezone id for the schedule. | string Constraints: Max length = 50 |
Usage Examples
Terraform Samples
A basic example of deploying Lab Services Labs Schedules.
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"
}
variable "admin_password" {
type = string
description = "The administrator password for the lab virtual machine"
sensitive = true
}
resource "azapi_resource" "resourceGroup" {
type = "Microsoft.Resources/resourceGroups@2020-06-01"
name = var.resource_name
location = var.location
}
resource "azapi_resource" "lab" {
type = "Microsoft.LabServices/labs@2022-08-01"
parent_id = azapi_resource.resourceGroup.id
name = var.resource_name
location = var.location
body = {
properties = {
autoShutdownProfile = {
shutdownOnDisconnect = "Disabled"
shutdownOnIdle = "None"
shutdownWhenNotConnected = "Disabled"
}
connectionProfile = {
clientRdpAccess = "None"
clientSshAccess = "None"
webRdpAccess = "None"
webSshAccess = "None"
}
securityProfile = {
openAccess = "Disabled"
}
title = "Test Title"
virtualMachineProfile = {
additionalCapabilities = {
installGpuDrivers = "Disabled"
}
adminUser = {
password = var.admin_password
username = "testadmin"
}
createOption = "Image"
imageReference = {
offer = "0001-com-ubuntu-server-focal"
publisher = "canonical"
sku = "20_04-lts"
version = "latest"
}
sku = {
capacity = 1
name = "Classic_Fsv2_2_4GB_128_S_SSD"
}
usageQuota = "PT0S"
useSharedPassword = "Disabled"
}
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
resource "azapi_resource" "schedule" {
type = "Microsoft.LabServices/labs/schedules@2022-08-01"
parent_id = azapi_resource.lab.id
name = var.resource_name
body = {
properties = {
stopAt = "2023-06-30T04:33:55Z"
timeZoneId = "America/Los_Angeles"
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}