Get-AzureNetworkSecurityGroup shows empty table

The purpose was to delete a lot of Network Security Groups (NSGs) using automation in PowerShell. But if we run Get-AzureNetworkSecurityGroup, it returns an empty output, despite having a lot of NSGs from creating Virtual Machines (VMs) in the Azure Portal.



This is because even if Azure Classic didn’t have NSGs like we use them in Resource Manager (RM), we need to use the RM version to find the Resource Manager NSGs.


Get-AzureRmNetworkSecurityGroup | select name


Leave a Reply


I am Roy Apalnes, a Microsoft Cloud Evangelist working av Sopra Steria. Main focus in Microsoft Security and Endpoint Management, with a bigger picture in mind.

Featured Posts