Adding VMs To Existing Azure Environment Through Powershell

I have often just built a some demo labs containing one or two VMs and then you want to add an additional VM to the same Resource Group, vNet, Subnet etc etc and still have the same naming conventions for all the components. I kind of found that bit difficult through the Azure portal, some component like a NIC or PIP would get a generated name or wouldnt follow the naming convention I had wanted.
So here we are with a little Powershell script that should help make it much easier.

First, if you havent already got one, build Resource Group, Storage Account and Networking components:

Secondly, once it has completed we need to set some parameters for the VM

Finally, we have to add the uniqueness to the parameters and then we can execute this

Leave a Reply

Your email address will not be published. Required fields are marked *