VirtualMachineCollection.GetAllAsync Method

Definition

Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines.

  • Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines
  • Operation Id: VirtualMachines_List
  • Default Api Version: 2024-07-01
  • Resource: VirtualMachineResource
public virtual Azure.AsyncPageable<Azure.ResourceManager.Compute.VirtualMachineResource> GetAllAsync (string filter = default, Azure.ResourceManager.Compute.Models.GetVirtualMachineExpandType? expand = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetAllAsync : string * Nullable<Azure.ResourceManager.Compute.Models.GetVirtualMachineExpandType> * System.Threading.CancellationToken -> Azure.AsyncPageable<Azure.ResourceManager.Compute.VirtualMachineResource>
override this.GetAllAsync : string * Nullable<Azure.ResourceManager.Compute.Models.GetVirtualMachineExpandType> * System.Threading.CancellationToken -> Azure.AsyncPageable<Azure.ResourceManager.Compute.VirtualMachineResource>
Public Overridable Function GetAllAsync (Optional filter As String = Nothing, Optional expand As Nullable(Of GetVirtualMachineExpandType) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As AsyncPageable(Of VirtualMachineResource)

Parameters

filter
String

The system query option to filter VMs returned in the response. Allowed value is 'virtualMachineScaleSet/id' eq /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}'.

expand
Nullable<GetVirtualMachineExpandType>

The expand expression to apply on operation. 'instanceView' enables fetching run time status of all Virtual Machines, this can only be specified if a valid $filter option is specified.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

An async collection of VirtualMachineResource that may take multiple service requests to iterate over.

Applies to