To create a new NSG deny rule using the Azure portal, we must follow these steps:
- In the NSG blade, locate the Outbound security rules option under Settings.
- Click on the Add button at the top of the page and wait for the new blade to open:
- In the new blade, we need to provide information for Source (location and port), Destination (location and port), Protocol, Action, Priority, Name, and Description. If you want to deny traffic, make sure you select Deny for Action. An example of how to create a rule to deny traffic over the 22 port is shown in the following screenshot: