Skip to main content

virtual_machines

Creates, updates, deletes, gets or lists a virtual_machines resource.

Overview

Namevirtual_machines
TypeResource
Idazure.dev_test_labs.virtual_machines

Fields

NameDatatypeDescription
idtextThe identifier of the resource.
nametextThe name of the resource.
allow_claimtextfield from the properties object
applicable_scheduletextfield from the properties object
artifact_deployment_statustextfield from the properties object
artifactstextfield from the properties object
compute_idtextfield from the properties object
compute_vmtextfield from the properties object
created_by_usertextfield from the properties object
created_by_user_idtextfield from the properties object
created_datetextfield from the properties object
custom_image_idtextfield from the properties object
data_disk_parameterstextfield from the properties object
disallow_public_ip_addresstextfield from the properties object
environment_idtextfield from the properties object
expiration_datetextfield from the properties object
fqdntextfield from the properties object
gallery_image_referencetextfield from the properties object
is_authentication_with_ssh_keytextfield from the properties object
labNametextfield from the properties object
lab_subnet_nametextfield from the properties object
lab_virtual_network_idtextfield from the properties object
last_known_power_statetextfield from the properties object
locationtextThe location of the resource.
network_interfacetextfield from the properties object
notestextfield from the properties object
os_typetextfield from the properties object
owner_object_idtextfield from the properties object
owner_user_principal_nametextfield from the properties object
passwordtextfield from the properties object
plan_idtextfield from the properties object
provisioning_statetextfield from the properties object
resourceGroupNametextfield from the properties object
schedule_parameterstextfield from the properties object
sizetextfield from the properties object
ssh_keytextfield from the properties object
storage_typetextfield from the properties object
subscriptionIdtextfield from the properties object
tagstextThe tags of the resource.
typetextThe type of the resource.
unique_identifiertextfield from the properties object
user_nametextfield from the properties object
virtual_machine_creation_sourcetextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTlabName, name, resourceGroupName, subscriptionIdGet virtual machine.
listSELECTlabName, resourceGroupName, subscriptionIdList virtual machines in a given lab.
create_or_updateINSERTlabName, name, resourceGroupName, subscriptionId, data__propertiesCreate or replace an existing virtual machine. This operation can take a while to complete.
deleteDELETElabName, name, resourceGroupName, subscriptionIdDelete virtual machine. This operation can take a while to complete.
updateUPDATElabName, name, resourceGroupName, subscriptionIdAllows modifying tags of virtual machines. All other properties will be ignored.
add_data_diskEXEClabName, name, resourceGroupName, subscriptionIdAttach a new or existing data disk to virtual machine. This operation can take a while to complete.
apply_artifactsEXEClabName, name, resourceGroupName, subscriptionIdApply artifacts to virtual machine. This operation can take a while to complete.
claimEXEClabName, name, resourceGroupName, subscriptionIdTake ownership of an existing virtual machine This operation can take a while to complete.
detach_data_diskEXEClabName, name, resourceGroupName, subscriptionIdDetach the specified disk from the virtual machine. This operation can take a while to complete.
redeployEXEClabName, name, resourceGroupName, subscriptionIdRedeploy a virtual machine This operation can take a while to complete.
resizeEXEClabName, name, resourceGroupName, subscriptionIdResize Virtual Machine. This operation can take a while to complete.
restartEXEClabName, name, resourceGroupName, subscriptionIdRestart a virtual machine. This operation can take a while to complete.
startEXEClabName, name, resourceGroupName, subscriptionIdStart a virtual machine. This operation can take a while to complete.
stopEXEClabName, name, resourceGroupName, subscriptionIdStop a virtual machine This operation can take a while to complete.
transfer_disksEXEClabName, name, resourceGroupName, subscriptionIdTransfers all data disks attached to the virtual machine to be owned by the current user. This operation can take a while to complete.
un_claimEXEClabName, name, resourceGroupName, subscriptionIdRelease ownership of an existing virtual machine This operation can take a while to complete.

SELECT examples

List virtual machines in a given lab.

SELECT
id,
name,
allow_claim,
applicable_schedule,
artifact_deployment_status,
artifacts,
compute_id,
compute_vm,
created_by_user,
created_by_user_id,
created_date,
custom_image_id,
data_disk_parameters,
disallow_public_ip_address,
environment_id,
expiration_date,
fqdn,
gallery_image_reference,
is_authentication_with_ssh_key,
labName,
lab_subnet_name,
lab_virtual_network_id,
last_known_power_state,
location,
network_interface,
notes,
os_type,
owner_object_id,
owner_user_principal_name,
password,
plan_id,
provisioning_state,
resourceGroupName,
schedule_parameters,
size,
ssh_key,
storage_type,
subscriptionId,
tags,
type,
unique_identifier,
user_name,
virtual_machine_creation_source
FROM azure.dev_test_labs.vw_virtual_machines
WHERE labName = '{{ labName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';

INSERT example

Use the following StackQL query and manifest file to create a new virtual_machines resource.

/*+ create */
INSERT INTO azure.dev_test_labs.virtual_machines (
labName,
name,
resourceGroupName,
subscriptionId,
data__properties,
location,
tags,
properties
)
SELECT
'{{ labName }}',
'{{ name }}',
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ data__properties }}',
'{{ location }}',
'{{ tags }}',
'{{ properties }}'
;

UPDATE example

Updates a virtual_machines resource.

/*+ update */
UPDATE azure.dev_test_labs.virtual_machines
SET
tags = '{{ tags }}'
WHERE
labName = '{{ labName }}'
AND name = '{{ name }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';

DELETE example

Deletes the specified virtual_machines resource.

/*+ delete */
DELETE FROM azure.dev_test_labs.virtual_machines
WHERE labName = '{{ labName }}'
AND name = '{{ name }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';