question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The command to get just an IP address of a VM is too complicated

See original GitHub issue

I’m playing with the new CLI and wanted to figure out what is the right command to get the public IP address of one of my VMs, so that I can connect to it from bash using ssh `az whatever`.

As far as I can tell, the command to do that is:

ssh `az vm list-ip-addresses -n vm-name --query [0].virtualMachine.network.publicIpAddresses[0].ipAddress -o tsv`

Is there a simpler way to do this? If not, I think that’s way too complicated for something like this.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
yugangw-msftcommented, Mar 30, 2017

@svick, you can use ‘az vm show -d’

1reaction
kgopi05commented, Oct 1, 2018

Getting below error when querying for ip address of the server (az vm show --name server01 | ConvertFrom-Json).publicIps -bash: syntax error near unexpected token `.publicIps’

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I set up an IP address on a Linux VM running in VM ...
1 Answer 1 ; Step 1: In VMWare Player's main window, right click on the VM name and select "Virtual Machine Settings". ;...
Read more >
How to find the IP Address of a VM running on VMware (or ...
First Go in the Virtual Machine Settings. Found the MAC address. Then in the Network Section, click the Advanced button and read the...
Read more >
How to get my own IP address and save it to a variable in a ...
I believe the "modern tools" way to get your ipv4 address is to parse ip rather than ifconfig , so it'd be something...
Read more >
How to Use the Netstat Command - Lifewire
The netstat command is used to show detailed network status information. Learn more about using this command and see several examples.
Read more >
If you're still using ifconfig, you're living in the past | Ubuntu
This is the main command that would be used in place of ifconfig. It will just display the IP addresses assigned to all...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found