Unable to get VM's IP address

Alphonse 1 Reputation point
2022-11-14T18:23:02.817+00:00

I am not able to get the VM's IP address after running az vm list-ip-addresses.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. JimmySalian-2011 44,721 Reputation points
    2022-11-14T18:25:14.653+00:00

    Hi,

    Did you tried the examples or this command to extract the IP address? vm

    az vm list-ip-addresses -g MyResourceGroup -n MyVm  
    

    Hope this helps.
    JS

    ==
    Please Accept the answer if the information helped you. This will help us and others in the community as well.

    0 comments No comments

  2. kobulloc-MSFT 26,846 Reputation points Microsoft Employee Moderator
    2022-11-15T08:13:37.59+00:00

    Hello, @Alphonse !

    Why do I get empty brackets [ ] when using az vm list-ip-addresses?
    Empty brackets will be returned if VMs can't be found, as in the case with this empty resource group. Confirm that the VM resource exists in the target destination (whether that be the subscription, resource group, VM name, or ID). If you've confirmed that the VM exists, we may need to do some troubleshooting to look at the health of the VM.

    260423-image.png

    Examples of az vm list-ip-addresses by itself and with optional parameters:

    az vm list-ip-addresses

    260360-image.png

    az vm list-ip-addresses -g MyResourceGroup -n MyVm

    260367-image.png

    0 comments No comments

  3. Anonymous
    2023-06-11T10:02:18.06+00:00

    Hi All, hopefully this helps.

    I am getting the same exact empty error whenever I run the commands.

    As a workaround I recreated it from the start (the Virtual Machine), and this has solved my issue, maybe this is a timeout issue where you should be performing the task within 30 mins or 1 hr as the VM usually expires, not entirely sure what causes this empty output but this is just a hunch based on my experience, it might be a different reason, but this one works for me.

    You can try other options as well. Happy exploring! :)

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.