Network Security Groups (NSGs) contain sets of rules that allow or deny specific traffic to specific resources or subnets in Azure. An NSG can be associated with either a subnet (applying security rules to all resources associated with the subnet) or a network interface (NIC) (applying security rules only to the VM associated with the NIC).
We will cover the following recipes in this chapter:
- Creating a new NSG in a portal
- Creating a new NSG with PowerShell
- Creating a new allow rule in NSG
- Creating a new deny rule in NSG
- Creating a new NSG rule with PowerShell
- Assigning an NSG to a subnet
- Assigning an NSG to network interface
- Assigning an NSG with PowerShell
- Creating an Application Security Group (ASG)
- Associating an ASG with a virtual machine (VM)
- Creating rules with an NSG and an ASG