Open Sandido opened 3 years ago
The cancellation token is not supported for this cmdlet
var result = VirtualMachineScaleSetVMsClient.Update(resourceGroupName, vmScaleSetName, instanceId, parameters);
To support cancellation, Comoute module should use UpdateAsync instead of Update.
//
// Summary:
// Updates a virtual machine of a VM scale set.
//
// Parameters:
// operations:
// The operations group for this extension method.
//
// resourceGroupName:
// The name of the resource group.
//
// vmScaleSetName:
// The name of the VM scale set where the extension should be create or updated.
//
// instanceId:
// The instance ID of the virtual machine.
//
// parameters:
// Parameters supplied to the Update Virtual Machine Scale Sets VM operation.
public static VirtualMachineScaleSetVM Update(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, VirtualMachineScaleSetVM parameters);
//
// Summary:
// Updates a virtual machine of a VM scale set.
//
// Parameters:
// operations:
// The operations group for this extension method.
//
// resourceGroupName:
// The name of the resource group.
//
// vmScaleSetName:
// The name of the VM scale set where the extension should be create or updated.
//
// instanceId:
// The instance ID of the virtual machine.
//
// parameters:
// Parameters supplied to the Update Virtual Machine Scale Sets VM operation.
//
// cancellationToken:
// The cancellation token.
[AsyncStateMachine(typeof(<UpdateAsync>d__9))]
public static Task<VirtualMachineScaleSetVM> UpdateAsync(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, VirtualMachineScaleSetVM parameters, CancellationToken cancellationToken = default);
Description
After creating a VMSS, I call Update-AzVmss to change the SkuCapacity. "Update-AzVmss -ResourceGroupName adsandorctrlc -VMScaleSetName vmssctrlc -SkuCapacity 10 -Debug"
The option appears asking if I want to continue and asks me to continue running the job with a Y. After I input Y and hit enter, the job starts, but then I try to Ctrl+C to cancel the job. This does not work, nothing happens. However, when I run the command in Azure CLI, "az vmss update --name vmssctrlc --resource-group adsandorctrlc --set sku.capacity=20 --debug", and confirm to run the job, I can Ctrl+C.
Desired behavior: Ctrl+C should allow me to cancel the cmdlet like it does in Az CLI.
Steps to reproduce
Environment data
Module versions
Debug output
Error output