Uncategorized

AZ CLI – Delete tagged groups in bash

Found that there was no proper example available how to do this in BASH, which I use often these days.

Without confirmation

#WSL or other Linux distro
G=$(az group list --tag 'svc=aksdev' --query "[].{name:name}" -o tsv) 

for res in $G
do
 echo "az group delete --id $res"
 az group delete --name $res --no-wait -y
done

With confirmation

#WSL or other Linux distro
G=$(az group list --tag 'svc=aksdev' --query "[].{name:name}" -o tsv) 

for res in $G
do
 echo "az group delete --id $res"
 az group delete --name $res --no-wait 
done

0 comments on “AZ CLI – Delete tagged groups in bash

Vastaa

Täytä tietosi alle tai klikkaa kuvaketta kirjautuaksesi sisään:

WordPress.com-logo

Olet kommentoimassa WordPress.com -tilin nimissä. Log Out /  Muuta )

Facebook-kuva

Olet kommentoimassa Facebook -tilin nimissä. Log Out /  Muuta )

Muodostetaan yhteyttä palveluun %s

%d bloggaajaa tykkää tästä: