In a typical computer system, you always want to create rules that determine who (or what) is allowed to access them. When using VMs, you will often leverage the capabilities of firewall software, which is provided with the system (or bought from an external vendor). Such a solution applies to a VM only—it does not forbid access to the whole network.
In Azure, you can use the concept of network security groups. They allow you to filter both the inbound and outbound traffic using custom rules, including protocols or the port range. In this section, you will learn how to extend the security of your VNets with NSGs and combine them to achieve an advanced filter.