0

Tried the below cmdlet to delete all resource groups in particular location:

az group list --query "[?location=='westus']".name -o tsv | xargs -otl az group delete -n

It is asking me to prompt for every resource group deletion.

Also tried adding the flag -y by reading this MS Doc,

az group list --query "[?location=='westus']".name -o tsv | xargs -otl az group delete -n -y

Error:

az group delete -n -y rg-1
argument --name/-n/--resource-group/-g: expected one argument

1 Answers1

0

While the documentation page doesn't appear to stipulate, in most other commands I've worked with when you wish to tell the system to bypass any confirmation prompts, that argument goes at the end, last in the list.

As noted, this is not clear in the documentation I have read on this command, but as OP notes, doing this resolved the issue.

music2myear
  • 49,799