I am trying to iterate over all the group names in given Azure subscription:
az group list --subscription XXX --query "{Name:id}"
This produces an array with elements in the following format: /subscriptions/XXX/resourceGroups/NAME
, which basically is the id of the resource group.
For each of these elements I want to select and extract just the NAME
. I tried to split based on "/" delimiter but it did not work. Has anyone faced similar use-case before and how did you extract just the group name from the id.