How to fetch resource group name( with pattern matching) using Azurecli
There are at least two ways to achieve this.

First is to go with transforming json output to proper object for PowerShell as described in this thread:


how do you select just one property from an array of “results” from the Azure command 'az group list in powershell'?


Second it to use --query global parameter for Azure CLI:

az group list --query "[?contains(name,'kafka')].name"


But remember to use at least PowerShell 6.2 as previous versions have an issue:


powershell --query error #9047