0

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.

yanis
  • 303
  • 3
  • 15

0 Answers0