Search code examples
azureazure-cli

Get only available resource list from the resource group using Azure CLI


Getting the unknown results than the available resources for the command we have tried:

az resource list -g senthil-b-rg -o table

Whatwetried

We do not want the results like Failure Anomalies. How to get the available resources only like sites, storage accounts, applications from the resource group using Azure CLI command?


Solution

  • You could always filter out the types you're not interested in using the --query parameter (see documentation):

    az resource list -g <resource-group-name> `
      -o table `
      --query "[?type != 'microsoft.alertsmanagement/smartDetectorAlertRules' && type != 'microsoft.insights/actiongroups']"