Network Security Group (NSG) is like a firewall or filter that contains inbound and outbound rules based on source or destination IP address, port, and protocol.
It can be associated with a subnet or with the network interfaces of a virtual machine. Its main task is to filter network traffic to and from the Azure resources for any Azure virtual machine.
In this blog, we will look at how to create a Network Security Group in Azure.
Without further ado, let’s check out how to do it.
How to Create a Network Security Group in Azure
Follow these steps to create a Network Security Group!
Step 1: Search for Network Security Group in the search bar and click on create.
Step 2: Provide the Resource group, Network Security Group Name, and Region, and click on Review + Create.

Step 3: Once you have created the Network Security Group, go to Resources. Over there, you can configure inbound and outbound rules.
Step 4: To create an inbound rule for allowing RDP in a subnet, click on Add inbound rule. Below are the parameters:
Source | Select IP addresses and provide your IP(You can choose any source as per your requirements) |
Source port ranges | Enter “*”(wildcard) to support any source |
Destination | Select “Any” from the dropdown |
Service | Select RDP (Remote Desktop Protocol) service |
Action | Allow |
Name | Provide a name |
Step 5: Click on add, and Azure will create the inbound rule.

Step 6: To associate this Network Security Group to a subnet, go to the subnet menu from NSG >> Select network & subnet >> Click OK. Once it is associated, The rule will apply to that particular subnet.
Wrapping up
With this simple 6-step process, you can create a variety of inbound and outbound rules. Using these rules, you can protect the underlying virtual machine from network-level attacks.
At SysAlly, we experiment with Cloud and the most useful information is passed on to the world as blogs. Signup for the updates.
Until later, here’s SysAlly signing off!