Returns a property value of a resource passing additional params as needed.
az-get <resource> <property> [additional params]
id=$(az-get image id --name my-image-name --resource-group my-resource-group-name)
# allows for deeply nested properties
agent=$(az-get vm osProfile.linuxConfiguration.provisionVmAgent --name vm-name --resource-group my-group)
Returns a list of group names resulting from az group list
. By default it will list all groups. All passed params will be searched for in the names of the groups using an or (||
).
az-group [search strings]
Calling az-group
without parameters is idential to az group list --query '[].name' --output tsv
.
Calling it with params will search for the substring(s) in the names of the groups.
# deletes all groups with the substring of deleteme *OR* killme
az-group deleteme killme | xargs --max-args 1 --no-run-if-empty az group delete --yes --name
Notes: --no-run-if-empty
is a GNU extensions and thus doesn't work on a Mac.