1

I have a python program that gives me all the details regarding different VM instances of a Virtual Machine Scale Set(VMSS) in Azure, in JSON format. However, I want something (a parameter) to identify which Public IP is for which instance.

The program just gives me a list of Public IP's of the all the instances now. So, let us assume that I want to get the Public IP of the 3rd instance specifically.

What should I do?

Software Fan
  • 609
  • 3
  • 8
  • 17

2 Answers2

1

Here's an example Python program that lists instance ID paired with public IP: https://github.com/gbowerman/azurerm/blob/main/examples/list_vmss_pips.py - the key is that the instance ID is embedded in the resource name for the IP address.

*It's important to note this is not the official azure sdk for python

sendmarsh
  • 1,046
  • 7
  • 11
0

The questions is not really valid.

Instances are all behind a LoadBalancer, technically because of source NAT the primary LoadBalancer IP is the out going Public IP for all traffic.

But incoming Public IP can be any FrontEnd IP depending on LoadBalancer rule or NAT Rule.

The public IP are not really tied to the instances, unless i am missing something.

Hannel
  • 1,656
  • 3
  • 10
  • 17
  • 2
    VM scale sets support public IP per VM, see https://learn.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-networking#public-ipv4-per-virtual-machine – sendmarsh Aug 01 '18 at 20:53
  • Yep, definitely missed that announcement. https://azure.microsoft.com/en-us/blog/new-networking-features-in-azure-scale-sets/ – Hannel Aug 01 '18 at 23:16