Assigning an NSG to a network interface
Now, we are going to widen our scope and show you how to associate an NSG with a network interface.
Getting ready
Before you start, open your browser and go to the Azure portal at https://portal.azure.com. Locate the previously created NSG.
How to do it...
To assign an NSG to a network interface, follow these steps:
- In the NSG pane, locate the Network interfaces option under Settings.
- Click on the Associate button at the top of the page and wait for the new pane to open:
Figure 3.9: Assigning the NSG to a network interface
- Select the NIC you want to associate the NSG with from the list of those available:
Figure 3.10: Associating with the network interface
How it works...
When an NSG is associated with an NIC, the NSG rules will apply only to a single NIC (or a VM associated with the NIC). The NIC can be associated with only one NSG directly, but a subnet associated with an NIC can have an association...