Create an Azure VM with multiple NICs

Azure-Logo-400x250

Multiple reasons needs a virtual machine (VM) to have multiple NICs, while this isn’t possible in the Azure Portal, we can create VMs with mutiple NICs using PS.

First is a script that creates your infrastructure with a virtual networking, containing multiple subnets, because most likely the reason for having multiple NICs is to have a backend and a frontend for a service, or perhaps a backend and a middle-end. But I do wonder if having multiple NICs in the same subnet, would be able to create a higher bandwith using a loadbalancer between the two NICs.

https://github.com/RoyApalnes/Microsoft/blob/master/StartAzureInfrastructure2.ps1

When we a virtual network with multiple subnets, we can create VMs with multiple NICs in separate Subnet. Keep in mind only some sizes of VMs support multiple NICs, see a list here, where the last column states number of NICs and Network bandwith. For now there is also a restriction to one public ip for each VM, and it is only allowed associated with the primary NIC, so be sure to set the internetfacing subnet on the NIC that becomes your primary NIC.

 https://github.com/RoyApalnes/Microsoft/blob/master/CreateAzureRmVm3.ps1

My next post will talk about using JSON templates rather then PowerShell, because JSON is becoming the most universal language for coding infrastructure.

Leave a Comment