az vmss delete ..., error: argument --force-deletion: expected one argument

273 Views Asked by At

I read document at https://learn.microsoft.com/en-us/azure/virtual-machines/delete?tabs=portal2%2Ccli3%2Cportal4%2Ccli5#force-delete-for-scale-sets

My command

az vmss delete --resource-group myResourceGroup_vy --name WindowsVM --force-deletion

Error

argument --force-deletion: expected one argument

Examples from AI knowledge base:
az vmss delete --name myscaleset --resource-group myresourcegroup
Deletes a VM scale set. (autogenerated)

az vmss delete --name myscaleset
Deletes a VM scale set. (autogenerated)

https://docs.microsoft.com/en-US/cli/azure/vmss#az_vmss_delete
Read more about the command in reference docs

Full content of Azure cloud shell https://gist.github.com/donhuvy/95c3f431d3f7a7824b3dd3f29ffd30eb

enter image description here

How to fix it? I just follow step-by-step document, but maybe reference document was wrong.

1

There are 1 best solutions below

0
Imran On

Created one Virtual machine scale set in my resource group like below:

enter image description here

When I ran same command to delete it, I got same error as you like below:

az vmss delete --resource-group myResourceGroup_vy --name WindowsVM --force-deletion

enter image description here

To delete the Virtual machine scale set, make use of below command:

az vmss delete --resource-group <RGName> --name <VmssName>--force-deletion true

According to the MSDoc when I add true in the command vmss deleted successfully like below.

Output:

enter image description here