[Network] Public IP addresses should be easier to retrieve for LB and NIC resources
See original GitHub issueIs there any way to use the az network lb
command group to retrieve the public IP address associated with a load balancer instance? Neither az network lb show
nor az network lb frontend-ip list
seem to actually provide this data. The only way I can figure out how to find this is via az network public-ip
commands, which makes sense, but seems kind of non-ideal, since I may have auto-created the public IP as part of creating the load balancer, and therefore, am logically managing the LB, not a separate public IP resource.
Oddly enough, if you look at the JSON output of either the network lb show
or network lb frontend-ip list
commands, there seems to be a property for the public IP address, but it doesn’t seem to ever be populated in my experience (is that a bug?). So in my tests, neither of the following queries ever return anything:
az network lb show -g foo -n foo --query "frontendIpConfigurations[].publicIpAddress.ipAddress"
az network lb frontend-ip list -g foo --lb-name foo --query "[].publicIpAddress.ipAddress"
And therefore, I have to retrieve the name of the public IP associated with the LB, and then run the following instead:
az network public-ip show -g foo -n PublicIPfoo --query "ipAddress"
Am I doing something wrong in the first example? Or is it expected that you’d need to use az network public-ip
commands to get the IP address?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:13 (12 by maintainers)
Top GitHub Comments
Reopening this with the
help wanted
tag in case the community would like to take this up. If it doesn’t progress after a time, we will close.Would it be worth considering an
az network lb list-ip-addresses
command that functioned similar to theaz vm list-ip-addresses
command? The scenario of retrieving an LB’s public IP seems common enough to potentially justify it.