@suvasara-MSFT , can you plz respond?
How to retrieve Azure FW & NSG info based on there tags?
1) How to retrieve Azure FW & NSG info based on there tags? I have a FW that have a tag (name = test), so I tried this query but its returning all the firewalls and not the filtered list
Get-AzFirewall | Where-Object Tags -eq $name | Select-Object -Property Name, ResourceType
2) Also how to retrieve Azure FW & NSG info based on a tag that is not there, say I want to retrieve FW/NSG list where name = test is not present?
I need the query for both FW & NSG lists related to the above 2 conditions.
2 answers
Sort by: Most helpful
-
-
suvasara-MSFT 10,041 Reputation points
2020-12-15T17:16:50.193+00:00 @Ananya Sarkar , Here are the PS commands to get Azure resource info using their tag values.
Azure Firewall: Get-AzResource -ResourceType Microsoft.Network/azureFirewalls -Tag @{'Name'='Test'} Azure NSG: Get-AzResource -ResourceType Microsoft.Network/networkSecurityGroups -Tag @{'Name'='Test'}
----------
Please do not forget to "Accept the answer" wherever the information provided helps you to help others in the community.