Skip to main content

virtual_machine_scale_set_vms

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

Overview

Namevirtual_machine_scale_set_vms
TypeResource
Idazure.compute.virtual_machine_scale_set_vms

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
additionalCapabilitiesobjectSpecifies additional capabilities enabled or disabled on the virtual machine in the scale set. For instance: whether the virtual machine has the capability to support attaching managed data disks with UltraSSD_LRS storage account type.
availabilitySetobjectSubResource.
diagnosticsProfileobjectSpecifies the boot diagnostic settings state. Minimum api-version: 2015-06-15.
etagstringEtag is property returned in Update/Get response of the VMSS VM, so that customer can supply it in the header to ensure optimistic updates.
hardwareProfileobjectSpecifies the hardware settings for the virtual machine.
identityobjectThe identity of the virtual machine, if configured.
instanceIdstringThe virtual machine instance ID.
instanceViewobjectThe virtual machine instance view.
interconnectBlockProfileobjectSpecifies the Interconnect Block related details of a Scale Set VM instance. Minimum api-version: 2026-03-01.
latestModelAppliedbooleanSpecifies whether the latest model has been applied to the virtual machine.
licenseTypestringSpecifies that the image or disk that is being used was licensed on-premises. Possible values for Windows Server operating system are: Windows_Client Windows_Server Possible values for Linux Server operating system are: RHEL_BYOS (for RHEL) SLES_BYOS (for SUSE) For more information, see Azure Hybrid Use Benefit for Windows Server _ Azure Hybrid Use Benefit for Linux Server _ Minimum api-version: 2015-06-15.
locationstringThe geo-location where the resource lives. Required.
modelDefinitionAppliedstringSpecifies whether the model applied to the virtual machine is the model of the virtual machine scale set or the customized model for the virtual machine.
networkProfileobjectSpecifies the network interfaces of the virtual machine.
networkProfileConfigurationobjectSpecifies the network profile configuration of the virtual machine.
osProfileobjectSpecifies the operating system settings for the virtual machine.
planobjectSpecifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click Want to deploy programmatically, Get Started ->. Enter any required information and then click Save.
protectionPolicyobjectSpecifies the protection policy of the virtual machine.
provisioningStatestringThe provisioning state, which only appears in the response.
resilientVMDeletionStatusstringSpecifies the resilient VM deletion status for the virtual machine. Known values are: "Enabled", "Disabled", "InProgress", and "Failed". (Enabled, Disabled, InProgress, Failed)
resourcesarrayThe virtual machine child extension resources.
securityProfileobjectSpecifies the Security related profile settings for the virtual machine.
skuobjectThe virtual machine SKU.
storageProfileobjectSpecifies the storage settings for the virtual machine disks.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
tagsobjectResource tags.
timeCreatedstring (date-time)Specifies the time at which the Virtual Machine resource was created. Minimum api-version: 2021-11-01.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".
userDatastringUserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. Minimum api-version: 2021-03-01.
virtualMachineResourceIdstringSpecifies the ARM resource ID of the standalone virtual machine associated with this VMSS VM. This property is only applicable to Virtual Machine Scale Sets with Flexible orchestration mode. Minimum api-version: 2025-11-01.
vmIdstringAzure VM unique ID.
zonesarrayThe virtual machine zones.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, vm_scale_set_name, instance_id, subscription_id$expandGets a virtual machine from a VM scale set.
listselectresource_group_name, virtual_machine_scale_set_name, subscription_id$filter, $select, $expandGets a list of all virtual machines in a VM scale sets.
updateupdateresource_group_name, vm_scale_set_name, instance_id, subscription_id, locationUpdates a virtual machine of a VM scale set.
deletedeleteresource_group_name, vm_scale_set_name, instance_id, subscription_idforceDeletionDeletes a virtual machine from a VM scale set.
get_instance_viewexecresource_group_name, vm_scale_set_name, instance_id, subscription_idGets the status of a virtual machine from a VM scale set.
approve_rolling_upgradeexecresource_group_name, vm_scale_set_name, instance_id, subscription_idApprove upgrade on deferred rolling upgrade for OS disk on a VM scale set instance.
deallocateexecresource_group_name, vm_scale_set_name, instance_id, subscription_idDeallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated.
reimageexecresource_group_name, vm_scale_set_name, instance_id, subscription_idReimages (upgrade the operating system) a specific virtual machine in a VM scale set.
reimage_allexecresource_group_name, vm_scale_set_name, instance_id, subscription_idAllows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks.
simulate_evictionexecresource_group_name, vm_scale_set_name, instance_id, subscription_idThe operation to simulate the eviction of spot virtual machine in a VM scale set.
attach_detach_data_disksexecresource_group_name, vm_scale_set_name, instance_id, subscription_idAttach and detach data disks to/from a virtual machine in a VM scale set.
perform_maintenanceexecresource_group_name, vm_scale_set_name, instance_id, subscription_idPerforms maintenance on a virtual machine in a VM scale set.
power_offexecresource_group_name, vm_scale_set_name, instance_id, subscription_idskipShutdownPower off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges.
redeployexecresource_group_name, vm_scale_set_name, instance_id, subscription_idShuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on.
restartexecresource_group_name, vm_scale_set_name, instance_id, subscription_idRestarts a virtual machine in a VM scale set.
retrieve_boot_diagnostics_dataexecresource_group_name, vm_scale_set_name, instance_id, subscription_idsasUriExpirationTimeInMinutesThe operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set.
startexecresource_group_name, vm_scale_set_name, instance_id, subscription_idStarts a virtual machine in a VM scale set.
run_commandexecresource_group_name, vm_scale_set_name, instance_id, subscription_id, commandIdRun command on a virtual machine in a VM scale set.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
instance_idstringThe instance ID of the virtual machine. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring
virtual_machine_scale_set_namestringThe name of the VirtualMachineScaleSet. Required.
vm_scale_set_namestringThe name of the VM scale set. Required.
$expandstringThe expand expression to apply to the operation. Allowed values are 'instanceView'. Default value is None.
$filterstringThe filter to apply to the operation. Allowed values are 'startswith(instanceView/statuses/code, 'PowerState') eq true', 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq false'. Default value is None.
$selectstringThe list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. Default value is None.
forceDeletionbooleanOptional parameter to force delete a virtual machine from a VM scale set. (Feature in Preview). Default value is None.
sasUriExpirationTimeInMinutesintegerExpiration duration in minutes for the SAS URIs with a value between 1 to 1440 minutes. Note: If not specified, SAS URIs will be generated with a default expiration duration of 120 minutes. Default value is None.
skipShutdownbooleanThe parameter to request non-graceful VM shutdown. True value for this flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not specified. Default value is None.

SELECT examples

Gets a virtual machine from a VM scale set.

SELECT
id,
name,
additionalCapabilities,
availabilitySet,
diagnosticsProfile,
etag,
hardwareProfile,
identity,
instanceId,
instanceView,
interconnectBlockProfile,
latestModelApplied,
licenseType,
location,
modelDefinitionApplied,
networkProfile,
networkProfileConfiguration,
osProfile,
plan,
protectionPolicy,
provisioningState,
resilientVMDeletionStatus,
resources,
securityProfile,
sku,
storageProfile,
systemData,
tags,
timeCreated,
type,
userData,
virtualMachineResourceId,
vmId,
zones
FROM azure.compute.virtual_machine_scale_set_vms
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND vm_scale_set_name = '{{ vm_scale_set_name }}' -- required
AND instance_id = '{{ instance_id }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND $expand = '{{ $expand }}'
;

UPDATE examples

Updates a virtual machine of a VM scale set.

UPDATE azure.compute.virtual_machine_scale_set_vms
SET
tags = '{{ tags }}',
location = '{{ location }}',
properties = '{{ properties }}',
plan = '{{ plan }}',
identity = '{{ identity }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND vm_scale_set_name = '{{ vm_scale_set_name }}' --required
AND instance_id = '{{ instance_id }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND location = '{{ location }}' --required
RETURNING
id,
name,
etag,
identity,
instanceId,
location,
plan,
properties,
resources,
sku,
systemData,
tags,
type,
zones;

DELETE examples

Deletes a virtual machine from a VM scale set.

DELETE FROM azure.compute.virtual_machine_scale_set_vms
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND vm_scale_set_name = '{{ vm_scale_set_name }}' --required
AND instance_id = '{{ instance_id }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND forceDeletion = '{{ forceDeletion }}'
;

Lifecycle Methods

Gets the status of a virtual machine from a VM scale set.

EXEC azure.compute.virtual_machine_scale_set_vms.get_instance_view 
@resource_group_name='{{ resource_group_name }}' --required,
@vm_scale_set_name='{{ vm_scale_set_name }}' --required,
@instance_id='{{ instance_id }}' --required,
@subscription_id='{{ subscription_id }}' --required
;