souser
souser

Reputation: 6124

How do I list the Inbound Port Rules in Azure?

Is there a way to list the "Inbound port rules" for a virtual machine from the command line (az cli) in Azure ?

I tried az vm show -n vm-name -g resource-group-name --show-details but it does not display the required information.

Edit : Based on the responses, I feel the need to provide more information :

  1. Login to the Azure Portal
  2. Navigate over to any virtual machine in your subscription
  3. In the left-nav, select Networking
  4. The rules will be displayed on your right side of the portal. The one I am interested in are Inbound port rules
  5. These are the manual steps to obtain this information
  6. I am looking for the exact same output from the command line using az cli

Upvotes: 1

Views: 1358

Answers (1)

Babatunde Victor
Babatunde Victor

Reputation: 106

Using Cli, specify the parameters below and use any custom options that relates to what you need.

az network nsg rule create --name --nsg-name --priority --resource-group [--access {Allow, Deny}] [--description] [--destination-address-prefixes] [--destination-asgs] [--destination-port-ranges] [--direction {Inbound, Outbound}] [--protocol {*, Ah, Esp, Icmp, Tcp, Udp}] [--source-address-prefixes] [--source-asgs] [--source-port-ranges] [--subscription]

https://learn.microsoft.com/en-us/cli/azure/network/nsg/rule?view=azure-cli-latest

You can refer to the link below if you have any difficulties. Don’t forget to reply to this comment and I will be there to help.

Upvotes: 1

Related Questions