Skip to content

Conversation

@guybartal
Copy link

updating az command which displays the correct public ip of the management VM

updating az command which displays the correct public ip of the management VM
@PRMerger20
Copy link
Contributor

@guybartal : Thanks for your contribution to the Azure documentation! The author, @dominicbetts, has been notified to review your proposed change.

@dominicbetts
Copy link
Contributor

Hi @guybartal - thanks for the suggested change. I've taken a look at your suggested az command. As an alternative, how about:
az vm list-ip-addresses --name YOUR-VM-NAME --output table

That gives better formatted output that our existing command, and shows just the public IP address of the relevant VM rather than needing you to scan through a list if you have multiple VMs?

@guybartal
Copy link
Author

You are correct @dominicbetts , but the Public IP in this case is associated to the external load balancer and not the VM, so you wont see it with this command, that's why I suggested this pull request. if you have another way to get it as single result go for it :)

@dominicbetts
Copy link
Contributor

Hi @guybartal - I expect I'm missing something, but both approaches (yours and mine) give the same IP address:

dominic@Azure:~$ az vm list-ip-addresses --name vm-q4t76 --o table
VirtualMachine    PublicIPAddresses    PrivateIPAddresses
----------------  -------------------  --------------------
vm-q4t76          51.144.102.181       10.0.0.4
dominic@Azure:~$ az network public-ip list -o table --query "[].[name,ipAddress]"
Column1              Column2
-------------------  --------------
domrmtest-public-ip  51.144.102.181

This account only has a single VM in it, so only one shows up in the list from your command. Under what circumstances would you expect the results of these two commands to give different IP addresses?

Thanks, Dominic

@dominicbetts
Copy link
Contributor

@guybartal - I'm closing this PR now - please let me know if you think it should be reopened - thanks!

@dominicbetts
Copy link
Contributor

#please-close

@PRMerger10 PRMerger10 closed this May 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants