summary import { ComputeManagementClient } from "@msinternal/compute-resource-manager" ; import { DefaultAzureCredential } from "@azure/identity" ; async function listsAllAvailableVirtualMachineSizesToWhichTheSpecifiedVirtualMachineCanBeResized ( ) { const subscriptionId = "{subscription-id}" ; const resourceGroupName = "myResourceGroup" ; const vmName = "myVmName" ; const credential = new DefaultAzureCredential ( ) ; const client = new ComputeManagementClient ( credential , subscriptionId ) ; const resArray = new Array ( ) ; for await ( let item of client . virtualMachines . listAvailableSizes ( resourceGroupName , vmName ) ) { resArray . push ( item ) ; } console . log ( resArray ) ; } listsAllAvailableVirtualMachineSizesToWhichTheSpecifiedVirtualMachineCanBeResized ( ) . catch ( console . error ) ;