Get Virtual Machine ScaleSet private IPs

Sorry for not posting stuff recently i’m really busy working with customers on really big project.In this post i’ll show you some tools i built in order to help myself in my daily work.

We’re working on a project that use dozens of virtual machine scalesets and each time they scale new ip are assigned which is good because the scalability isĀ  key on our work, but when you want to troubleshoot problems sometimes you just don’t want to shoot a VM and go deep inside the VM to get it work again, we’re not talking about containers here. And in order to get access to your Instances (VM) in a Scaleset you have to find the private IP that is used.

This stuff is pretty hard to get, no information on the portail and obviously no easy information in PowerShell…

The solution is to use Get-AzureRmResource to trigger the ARM APIs in order to get everything we need which isn’t really easy to use… So, i built this little PowerShell script.

Example 1: You want to list all Instance PrivateIP in a Resource Group in a specific subscription

Get VMScalesetPrivateIP

Example 2: You want to list all instances in a specific ScaleSet

Get Target VMSS PrivateIPs

Below the code used in this script, hope you’ll find it usefull.