Single to Multi NIC Azure Resource Manager VM

Have you ever created a virtual machine in Azure with a single NIC, only to find later that you need another network interface? I know I have!At the time of writing there is no way to do this through the Azure Portal. There also doesn’t seem to be much information on it if you’re using the newer Resource Manager deployment model. Here’s some notes I made to make it happen.

This involves a major reconfiguration of your virtual machine. I take no responsibility if these steps don’t work or cause a problem for you!

Pre-requisites

  1. Azure Powershell
  2. Second network interface created in Azure Portal
  3. Existing network security group with that network interface associated in Azure Portal
  4. Screenshots of key settings, especially name, size, resource group, location, and disks
  5. Shutdown virtual machine
  6. Deleted virtual machine

I didn’t need an availability set so that’s not covered here.

PowerShell script

Start with the following script, and amend it for your needs:

To keep it easy to read, I didn’t use any variables except for the repetitive Resource Group name. You can find details of your disks in the storage account for the VM, under the “vhds” container.

Once you run this and log in, wait a few minutes for it to churn through. At the end you should be able to go into the Azure Portal and see your VM back again – now with another network interface.