'az vmss list command returns empty value

I have two resource groups in Azure, each contains one VMSS (Virtual Machine Scale Sets) and the resources are visible in Azure Portal. The problem is, the following commands return empty output:

az resource list --subscription MySubscription -g vmss-rg
az vmss list --subscription MySubscription -g vmss-rg
az vmss list

However, running az resource list with different resource groups which doesn't have VMSS works fine. I also tested it with different Azure account and subscription, it also worked.



Solution 1:[1]

We have tested the same command in our local as suggested by @VenkateshDodda-MT and it works fine. Posting it as an answer to help other community members for the similar issue so that they can find and fix their problem.

To achieve the above requirement we need to install the az powershell module in our local .

Post that run the command in powershell to get the vmss list under our subscription or resource groups:-

az resource list --resource-type  "Microsoft.Compute/virtualMachineScaleSets"

OUTPUT:-

enter image description here

To get the VMSS list under particular resource group run the below cmd:

az resource list --resource-type  "Microsoft.Compute/virtualMachineScaleSets" -g '<rgName>'

OUTPUT:- enter image description here

For more information please refer this SO THREAD:Azure PS command returns empty list as suggested by @Olga Osinskaya - MSFT

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 AjayKumarGhose-MT