Labs - Update
Operation to update a lab resource.
PATCH https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}?api-version=2023-06-07
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
lab
|
path | True |
string minLength: 1maxLength: 100 |
The name of the lab that uniquely identifies it within containing lab plan. Used in resource URIs. |
|
resource
|
path | True |
string minLength: 1maxLength: 90 |
The name of the resource group. The name is case insensitive. |
|
subscription
|
path | True |
string minLength: 1 |
The ID of the target subscription. |
|
api-version
|
query | True |
string minLength: 1 |
The API version to use for this operation. |
Request Body
| Name | Type | Description |
|---|---|---|
| properties.autoShutdownProfile |
The resource auto shutdown configuration for the lab. This controls whether actions are taken on resources that are sitting idle. |
|
| properties.connectionProfile |
The connection profile for the lab. This controls settings such as web access to lab resources or whether RDP or SSH ports are open. |
|
| properties.description |
string |
The description of the lab. |
| properties.labPlanId |
string minLength: 3maxLength: 2000 |
The ID of the lab plan. Used during resource creation to provide defaults and acts as a permission container when creating a lab via labs.azure.com. Setting a labPlanId on an existing lab provides organization.. |
| properties.rosterProfile |
The lab user list management profile. |
|
| properties.securityProfile |
The lab security profile. |
|
| properties.title |
string minLength: 1maxLength: 120 |
The title of the lab. |
| properties.virtualMachineProfile |
The profile used for creating lab virtual machines. |
|
| tags |
string[] |
Resource tags. |
Responses
| Name | Type | Description |
|---|---|---|
| 200 OK |
The resource was updated; response contains the Lab. |
|
| 202 Accepted |
The resource was update and has a long running operation; response contains the Lab. |
|
| Other Status Codes |
The default error response. |
Examples
patchLab
Sample request
PATCH https://management.azure.com/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.LabServices/labs/testlab?api-version=2023-06-07
{
"properties": {
"securityProfile": {
"openAccess": "Enabled"
}
}
}
Sample response
{
"id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.LabServices/labs/testlab",
"name": "testlabplan",
"type": "Microsoft.LabServices/Lab",
"location": "westus",
"systemData": {
"createdBy": "identity123",
"createdByType": "User",
"createdAt": "2020-05-01T10:00:00Z",
"lastModifiedBy": "identity123",
"lastModifiedByType": "User",
"lastModifiedAt": "2020-06-01T09:12:28Z"
},
"properties": {
"provisioningState": "Succeeded",
"connectionProfile": {
"webSshAccess": "None",
"webRdpAccess": "None",
"clientSshAccess": "Public",
"clientRdpAccess": "Public"
},
"autoShutdownProfile": {
"shutdownOnDisconnect": "Enabled",
"shutdownWhenNotConnected": "Enabled",
"shutdownOnIdle": "UserAbsence",
"disconnectDelay": "PT5M",
"noConnectDelay": "PT5M",
"idleDelay": "PT5M"
},
"securityProfile": {
"registrationCode": "fAkEcodE",
"openAccess": "Enabled"
},
"networkProfile": {
"subnetId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/id"
},
"virtualMachineProfile": {
"createOption": "TemplateVM",
"imageReference": {
"offer": "WindowsServer",
"publisher": "Microsoft",
"sku": "2019-Datacenter",
"version": "2019.0.20190410"
},
"sku": {
"name": "Medium",
"capacity": 20
},
"additionalCapabilities": {
"installGpuDrivers": "Disabled"
},
"usageQuota": "PT10H",
"useSharedPassword": "Disabled",
"adminUser": {
"username": "test-user"
}
},
"title": "Test Lab",
"description": "This is a test lab.",
"labPlanId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.LabServices/labPlans/testlabplan",
"state": "Draft"
}
}
Location: https://management.azure.com/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/providers/Microsoft.LabServices/operationresults/a64149d8-84cb-4566-ab8e-b4ee1a074174
{
"id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.LabServices/labs/testlab",
"name": "testlabplan",
"type": "Microsoft.LabServices/Lab",
"location": "westus",
"systemData": {
"createdBy": "identity123",
"createdByType": "User",
"createdAt": "2020-05-01T10:00:00Z",
"lastModifiedBy": "identity123",
"lastModifiedByType": "User",
"lastModifiedAt": "2020-06-01T09:12:28Z"
},
"properties": {
"provisioningState": "Updating",
"connectionProfile": {
"webSshAccess": "None",
"webRdpAccess": "None",
"clientSshAccess": "Public",
"clientRdpAccess": "Public"
},
"autoShutdownProfile": {
"shutdownOnDisconnect": "Enabled",
"shutdownWhenNotConnected": "Enabled",
"shutdownOnIdle": "UserAbsence",
"disconnectDelay": "PT5M",
"noConnectDelay": "PT5M",
"idleDelay": "PT5M"
},
"securityProfile": {
"registrationCode": "fAkEcodE",
"openAccess": "Enabled"
},
"networkProfile": {
"subnetId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/default"
},
"virtualMachineProfile": {
"createOption": "TemplateVM",
"imageReference": {
"offer": "WindowsServer",
"publisher": "Microsoft",
"sku": "2019-Datacenter",
"version": "2019.0.20190410"
},
"osType": "Windows",
"sku": {
"name": "Medium",
"capacity": 20
},
"additionalCapabilities": {
"installGpuDrivers": "Disabled"
},
"usageQuota": "PT10H",
"useSharedPassword": "Disabled",
"adminUser": {
"username": "test-user"
}
},
"title": "Test Lab",
"description": "This is a test lab.",
"labPlanId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.LabServices/labPlans/testlabplan",
"state": "Draft"
}
}
Definitions
| Name | Description |
|---|---|
|
Auto |
Profile for how to handle shutting down virtual machines. |
|
Connection |
Connection profile for how users connect to lab virtual machines. |
|
Connection |
The enabled access level for Web Access over SSH. |
|
created |
The type of identity that created the resource. |
|
Create |
Indicates what lab virtual machines are created from. |
| Credentials |
Credentials for a user on a lab VM. |
|
Enable |
Whether shutdown on disconnect is enabled |
|
Error |
The resource management error additional info. |
|
Error |
The error detail. |
|
Error |
Error response |
|
Image |
Image reference information. Used in the virtual machine profile. |
| Lab |
The lab resource. |
|
Lab |
Profile for how to handle networking for Labs. |
|
Lab |
The state of a virtual machine. |
|
Lab |
The lab resource for updates. |
|
Os |
The OS type of the image |
|
Provisioning |
Current provisioning state of the lab. |
|
Resource |
Error details of the latest operation failure on this resource |
|
Roster |
The lab user list management profile. |
|
Security |
The lab security profile. |
|
shutdown |
Defines whether to shut down VM on idle and the criteria for idle detection. |
| Sku |
The resource model definition representing SKU |
|
Sku |
This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT. |
|
system |
Metadata pertaining to creation and last modification of the resource. |
|
Virtual |
The additional capabilities for a lab VM. |
|
Virtual |
The base virtual machine configuration for a lab. |
AutoShutdownProfile
Profile for how to handle shutting down virtual machines.
| Name | Type | Default value | Description |
|---|---|---|---|
| disconnectDelay |
string (duration) |
The amount of time a VM will stay running after a user disconnects if this behavior is enabled. |
|
| idleDelay |
string (duration) |
The amount of time a VM will idle before it is shutdown if this behavior is enabled. |
|
| noConnectDelay |
string (duration) |
The amount of time a VM will stay running before it is shutdown if no connection is made and this behavior is enabled. |
|
| shutdownOnDisconnect | Disabled |
Whether shutdown on disconnect is enabled |
|
| shutdownOnIdle | None |
Whether a VM will get shutdown when it has idled for a period of time. |
|
| shutdownWhenNotConnected | Disabled |
Whether a VM will get shutdown when it hasn't been connected to after a period of time. |
ConnectionProfile
Connection profile for how users connect to lab virtual machines.
| Name | Type | Default value | Description |
|---|---|---|---|
| clientRdpAccess | None |
The enabled access level for Client Access over RDP. |
|
| clientSshAccess | None |
The enabled access level for Client Access over SSH. |
|
| webRdpAccess | None |
The enabled access level for Web Access over RDP. |
|
| webSshAccess | None |
The enabled access level for Web Access over SSH. |
ConnectionType
The enabled access level for Web Access over SSH.
| Value | Description |
|---|---|
| Public | |
| Private | |
| None |
createdByType
The type of identity that created the resource.
| Value | Description |
|---|---|
| User | |
| Application | |
| ManagedIdentity | |
| Key |
CreateOption
Indicates what lab virtual machines are created from.
| Value | Description |
|---|---|
| Image |
An image is used to create all lab user virtual machines. When this option is set, no template VM will be created. |
| TemplateVM |
A template VM will be used to create all lab user virtual machines. |
Credentials
Credentials for a user on a lab VM.
| Name | Type | Description |
|---|---|---|
| password |
string |
The password for the user. This is required for the TemplateVM createOption. |
| username |
string |
The username to use when signing in to lab VMs. |
EnableState
Whether shutdown on disconnect is enabled
| Value | Description |
|---|---|
| Enabled | |
| Disabled |
ErrorAdditionalInfo
The resource management error additional info.
| Name | Type | Description |
|---|---|---|
| info |
object |
The additional info. |
| type |
string |
The additional info type. |
ErrorDetail
The error detail.
| Name | Type | Description |
|---|---|---|
| additionalInfo |
The error additional info. |
|
| code |
string |
The error code. |
| details |
The error details. |
|
| message |
string |
The error message. |
| target |
string |
The error target. |
ErrorResponse
Error response
| Name | Type | Description |
|---|---|---|
| error |
The error object. |
ImageReference
Image reference information. Used in the virtual machine profile.
| Name | Type | Description |
|---|---|---|
| exactVersion |
string |
The actual version of the image after use. |
| id |
string minLength: 3maxLength: 2000 |
Image resource ID |
| offer |
string |
The image offer if applicable. |
| publisher |
string |
The image publisher |
| sku |
string |
The image SKU |
| version |
string |
The image version specified on creation. |
Lab
The lab resource.
| Name | Type | Description |
|---|---|---|
| id |
string |
Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} |
| location |
string |
The geo-location where the resource lives |
| name |
string |
The name of the resource |
| properties.autoShutdownProfile |
The resource auto shutdown configuration for the lab. This controls whether actions are taken on resources that are sitting idle. |
|
| properties.connectionProfile |
The connection profile for the lab. This controls settings such as web access to lab resources or whether RDP or SSH ports are open. |
|
| properties.description |
string |
The description of the lab. |
| properties.labPlanId |
string minLength: 3maxLength: 2000 |
The ID of the lab plan. Used during resource creation to provide defaults and acts as a permission container when creating a lab via labs.azure.com. Setting a labPlanId on an existing lab provides organization.. |
| properties.networkProfile |
The network profile for the lab, typically applied via a lab plan. This profile cannot be modified once a lab has been created. |
|
| properties.provisioningState |
Current provisioning state of the lab. |
|
| properties.resourceOperationError |
Error details of last operation done on lab. |
|
| properties.rosterProfile |
The lab user list management profile. |
|
| properties.securityProfile |
The lab security profile. |
|
| properties.state |
The lab state. |
|
| properties.title |
string minLength: 1maxLength: 120 |
The title of the lab. |
| properties.virtualMachineProfile |
The profile used for creating lab virtual machines. |
|
| systemData |
Metadata pertaining to creation and last modification of the lab. |
|
| tags |
object |
Resource tags. |
| type |
string |
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" |
LabNetworkProfile
Profile for how to handle networking for Labs.
| Name | Type | Description |
|---|---|---|
| loadBalancerId |
string minLength: 3maxLength: 2000 |
The external load balancer resource id |
| publicIpId |
string minLength: 3maxLength: 2000 |
The external public IP resource id |
| subnetId |
string minLength: 3maxLength: 2000 |
The external subnet resource id |
LabState
The state of a virtual machine.
| Value | Description |
|---|---|
| Draft |
The lab is currently in draft (has not been published). |
| Publishing |
The lab is publishing. |
| Scaling |
The lab is scaling. |
| Syncing |
The lab is syncing users. |
| Published |
The lab has been published. |
LabUpdate
The lab resource for updates.
| Name | Type | Description |
|---|---|---|
| properties.autoShutdownProfile |
The resource auto shutdown configuration for the lab. This controls whether actions are taken on resources that are sitting idle. |
|
| properties.connectionProfile |
The connection profile for the lab. This controls settings such as web access to lab resources or whether RDP or SSH ports are open. |
|
| properties.description |
string |
The description of the lab. |
| properties.labPlanId |
string minLength: 3maxLength: 2000 |
The ID of the lab plan. Used during resource creation to provide defaults and acts as a permission container when creating a lab via labs.azure.com. Setting a labPlanId on an existing lab provides organization.. |
| properties.rosterProfile |
The lab user list management profile. |
|
| properties.securityProfile |
The lab security profile. |
|
| properties.title |
string minLength: 1maxLength: 120 |
The title of the lab. |
| properties.virtualMachineProfile |
The profile used for creating lab virtual machines. |
|
| tags |
string[] |
Resource tags. |
OsType
The OS type of the image
| Value | Description |
|---|---|
| Windows | |
| Linux |
ProvisioningState
Current provisioning state of the lab.
| Value | Description |
|---|---|
| Creating |
Resource is in the process of being created. |
| Updating |
New property values are being applied to the resource. |
| Deleting |
Resource is in the process of being deleted. |
| Succeeded |
Resource is in healthy state after creation or update operation. |
| Failed |
Previous operation on the resource has failed leaving resource in unhealthy state. |
| Locked |
The resource is locked and changes are currently blocked. This could be due to maintenance or a scheduled operation. The state will go back to succeeded once the locking operation has finished. |
ResourceOperationError
Error details of the latest operation failure on this resource
| Name | Type | Description |
|---|---|---|
| action |
string |
The operation action that failed |
| code |
string |
The code that corresponds to the type of operation failure |
| message |
string |
The operation failure message |
| timestamp |
string (date-time) |
The datetime of when the error occured |
RosterProfile
The lab user list management profile.
| Name | Type | Description |
|---|---|---|
| activeDirectoryGroupId |
string |
The AAD group ID which this lab roster is populated from. Having this set enables AAD sync mode. |
| lmsInstance |
string |
The base URI identifying the lms instance. |
| ltiClientId |
string |
The unique id of the azure lab services tool in the lms. |
| ltiContextId |
string |
The unique context identifier for the lab in the lms. |
| ltiRosterEndpoint |
string |
The uri of the names and roles service endpoint on the lms for the class attached to this lab. |
SecurityProfile
The lab security profile.
| Name | Type | Description |
|---|---|---|
| openAccess |
Whether any user or only specified users can register to a lab. |
|
| registrationCode |
string |
The registration code for the lab. |
shutdownOnIdleMode
Defines whether to shut down VM on idle and the criteria for idle detection.
| Value | Description |
|---|---|
| None |
The VM won't be shut down when it is idle. |
| UserAbsence |
The VM will be considered as idle when there is no keyboard or mouse input. |
| LowUsage |
The VM will be considered as idle when user is absent and the resource (CPU and disk) consumption is low. |
Sku
The resource model definition representing SKU
| Name | Type | Description |
|---|---|---|
| capacity |
integer (int32) |
If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted. |
| family |
string |
If the service has different generations of hardware, for the same SKU, then that can be captured here. |
| name |
string |
The name of the SKU. Ex - P3. It is typically a letter+number code |
| size |
string |
The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. |
| tier |
This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT. |
SkuTier
This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT.
| Value | Description |
|---|---|
| Free | |
| Basic | |
| Standard | |
| Premium |
systemData
Metadata pertaining to creation and last modification of the resource.
| Name | Type | Description |
|---|---|---|
| createdAt |
string (date-time) |
The timestamp of resource creation (UTC). |
| createdBy |
string |
The identity that created the resource. |
| createdByType |
The type of identity that created the resource. |
|
| lastModifiedAt |
string (date-time) |
The timestamp of resource last modification (UTC) |
| lastModifiedBy |
string |
The identity that last modified the resource. |
| lastModifiedByType |
The type of identity that last modified the resource. |
VirtualMachineAdditionalCapabilities
The additional capabilities for a lab VM.
| Name | Type | Default value | Description |
|---|---|---|---|
| installGpuDrivers | Disabled |
Flag to pre-install dedicated GPU drivers. |
VirtualMachineProfile
The base virtual machine configuration for a lab.
| Name | Type | Default value | Description |
|---|---|---|---|
| additionalCapabilities |
Additional VM capabilities. |
||
| adminUser |
Credentials for the admin user on the VM. |
||
| createOption |
Indicates what lab virtual machines are created from. |
||
| imageReference |
The image configuration for lab virtual machines. |
||
| nonAdminUser |
Credentials for the non-admin user on the VM, if one exists. |
||
| osType |
The OS type of the image |
||
| sku |
The SKU for the lab. Defines the type of virtual machines used in the lab. |
||
| usageQuota |
string (duration) |
The initial quota alloted to each lab user. Must be a time span between 0 and 9999 hours. |
|
| useSharedPassword | Disabled |
Enabling this option will use the same password for all user VMs. |