Get VM IP address

How Do I Find The IP Address Of My Azure VM?

This Azure article will discuss how to get VM IP address using Azure Portal and PowerShell.

Get VM IP address

You can find the IP Address Of your Azure Virtual machine with a few clicks in the Azure Portal. Follow the below steps to find the IP of your Azure VM.

  1. Log in to the Azure Portal (https://portal.azure.com/)
  2. Once you log in to the Azure Portal, Search for the Virtual Machine.
How Do I Find The IP Address Of My Azure VM?

3. Once you click on the search result in Virtual Machines, you can see all your virtual machines listed below. Click on the specific virtual machine you want to check the IP address for.

how to find ip address of azure vm

4. On the Virtual machine page, you can see the Public IP address highlighted below.

Find ip address of azure vm

You can also click on the Networking option from the left navigation on the Virtual machine page. You can see the Public and private IP addresses for the virtual machine as highlighted below

Figure out ip address of azure vm

5. By default, the IP address of the Azure Virtual machine is dynamic; if you want to change the dynamic IP of the VM to a Static IP address, you can click on the IP address as highlighted below.

azure create vm with static private ip

6. Now, on the below window, change the Assignment option from Dynamic to Static and click the Save button to save the changes. Now, the IP address of your Azure Virtual Machine has become Static.

powershell get vm ip address

So this is How you can find the IP address of your Azure VM and you can also able to change the IP address of your Virtual machine from dynamic to static or static to dynamic.

Get VM IP address PowerShell

You can also able to retrieve the IP address of your Azure Virtual Machine using PowerShell. Use the below PowerShell Script to get the IP address for your Azure VM

$vmdetailsreport = @()
$vmList = get-azurermvm
$vmnic = get-azurermnetworkinterface | ?{ $_.VirtualMachine -NE $null}
 
foreach($nic in $vmnic)
{
    $details = "" | Select VmName, ResourceGroupName, HostName, IpAddress
    $myvm = $vmList | ? -Property Id -eq $nic.VirtualMachine.id
    $details.VMName = $myvm.Name
    $details.ResourceGroupName = $myvm.ResourceGroupName
    $details.IpAddress = $nic.IpConfigurations.PrivateIpAddress
    $details.HostName = $myvm.OSProfile.ComputerName
    $vmdetailsreport+=$details
}

You can see the output as below

get-azurermnetworkinterface

This is How you can retrieve the IP address of your Azure VM using the above PowerShell Script.

FAQs

Does virtual machine have its own IP address?

The answer is Yes, virtual machines are like physical computers. A virtual machine can have one or more IP addresses. The IP address can be public or private. When we are talking about the IP addresses in the case of Virtual Machines, they are closely associated with the network interfaces. Again, the Network interfaces with the Network adapters.

You may also like following the articles below

Final Thoughts

In this Azure article, we discussed the quick steps to get the IP address of your Azure Virtual Machine. Thanks for reading this article !!!