1
votes

I have an Azure Load Balancer in front of a Azure VM Scale Set (VMSS). I also have a NAT pool configured on the Load Balancer like the following:

{ "name": "InstanceInputEndpointNatPool", "properties": { "backendPort": 10000, "frontendIPConfiguration": { "id": "[concat(resourceId('Microsoft.Network/loadBalancers', variables('loadBalancers_01_name')), '/frontendIPConfigurations/LoadBalancerIPConfig')]" }, "frontendPortRangeStart": 10100, "frontendPortRangeEnd": 10500, "protocol": "Tcp" } }

Essentially, for each VM in the VMSS, the load balancer forwards a request received at DNSName:PORT(between 10100-10500) to one of the VMs:10000(same backend port).

Is it possible to retrieve the PORT assigned to this VM, programmatically in C#, for a program running on that VM? This would help me directly target that VM port.

1

1 Answers

-1
votes

You may refer the article and find the code on GitHub link.