I'm trying to automate few of our BAT script and for this our script need to know the private IP of each instances of VMSS(no public IP for instances).
Is there a way to query the private IP of all instances under a particular VMSS using azure cli. I tried few command of LB and VMSS but didn't find a solution yet.
az vmss show -g <rg> -n <vmss>
az vmss list-instances -g <rg> -n <vmss>
az vmss nic list-vm-nics -g <rg> --vmss-name <vmss> --ids <id>
az network lb address-pool list -g <rg> --lb-name <lb>
az vmss list-instance-connection-info -g <rg> -n <vmss>
Any help is highly appreciable and I'm not looking for powershell.
Select ipconfig1 in the IP configurations page. Select Static in Assignment. Change the private IP address if you want a different one, and then select Save. If you change the private IP address, the VM associated with the network interface will be restarted to utilize the new IP address.
You can use the Azure CLI and bash command:
az vmss nic list -g groupName --vmss-name ScaleSetName | grep -w "privateIpAddress"
It can show all the private ips like this:
"privateIpAddress": "192.168.1.4",
"privateIpAddress": "192.168.1.5",
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With