Detaching an NIC from a VM
Just as with attaching an NIC, we can detach an NIC at any time and attach it to another VM.
Getting ready
Before you start, open a web browser and go to the Azure portal at https://portal.azure.com. Here, locate the previously created VM.
How to do it...
To detach an NIC from a VM, we must do the following:
- In the VM pane, make sure the VM is stopped (that is, deallocated).
- Locate the Networking settings in the VM pane.
- At the top of the Networking settings screen in the VM pane, select the Detach network interface option.
- Select the NIC you want to detach from the VM.
- Click OK and, in a few moments, the process will finish and the NIC will be removed from the VM. An example of this is shown in Figure 2.15:
Figure 2.15: Detaching an NIC
How it works...
To detach an NIC, the VM associated with the NIC must be stopped (that is, deallocated). At least one NIC must be associated with the VM—so you can't remove the last NIC from a VM. All network associations stay with the NIC—they are assigned to the NIC, not to the VM.