Skill 4.2.1
Create and configure network security groups (NSGs) and application security groups
Key Concepts
An NSG contains inbound and outbound security rules, each with a priority (100 to 4096; a lower number is processed first), source, source port, destination, destination port, protocol (TCP, UDP, ICMP or Any) and action (Allow or Deny). Processing stops at the first match. Sources and destinations can be IP ranges, service tags such as Internet, VirtualNetwork, AzureLoadBalancer or Storage.WestEurope, or application security groups. Default rules (priorities 65000 to 65500) allow traffic within the VNet and from the load balancer, allow outbound internet, and deny everything else; they cannot be deleted but can be overridden. NSG rules are stateful, so return traffic is allowed automatically.
An NSG is associated with a subnet, a network interface or both, and can be reused across many. An application security group (ASG) is a label assigned to network interfaces, such as asg-web and asg-db; a rule such as "allow asg-web to asg-db on 1433" then follows VMs as they are added or removed, without IP addresses. All NICs in an ASG must be in the same VNet as the first NIC assigned to it.