Is there a better way to search by IP address in the portal? Both Public & Private?

%3CLINGO-SUB%20id%3D%22lingo-sub-813676%22%20slang%3D%22en-US%22%3EIs%20there%20a%20better%20way%20to%20search%20by%20IP%20address%20in%20the%20portal%3F%20Both%20Public%20%26amp%3B%20Private%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-813676%22%20slang%3D%22en-US%22%3E%3CP%3EI%20know%20that%20you%20can%20list%20the%20VM's%20and%20show%20the%20ip%20addresses%20on%20the%20VM%20list%2C%20but%20short%20of%20digging%20through%20every%20row%20finding%20a%20machine%20by%20ip%20is%20a%20pain.%26nbsp%3B%20Private%20connected%20networks%2C%20I%20can%20ping%20it%20with%20a%20name%20resolution%20to%20get%20the%20name%20to%20search%20for%20that%2C%20but%20on%20the%20public%20side%20I%20can't%2C%20or%20for%20servers%20in%20a%20different%20network%20I%20can't.%3C%2FP%3E%3CP%3EThanks%2C%3C%2FP%3E%3CP%3ERuss%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-820729%22%20slang%3D%22en-US%22%3ERe%3A%20Is%20there%20a%20better%20way%20to%20search%20by%20IP%20address%20in%20the%20portal%3F%20Both%20Public%20%26amp%3B%20Private%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-820729%22%20slang%3D%22en-US%22%3E%3CP%3EAre%20you%20looking%20for%20Public%20or%20Private%20IPs%3F%20It%20sounds%20like%20Public%20IPs.%20If%20that's%20the%20case%2C%20you%20can%20in%20the%20Portal%2C%20go%20to%20%22All%20Services%22%20then%20search%20for%20%22Public%20IP%20Addresses%22%20(which%20I%20made%20a%20favorite)%2C%20then%20once%20you%20go%20to%20that%2C%20you%20can%20click%20on%20%22Edit%20Columns%22%20at%20the%20top%2C%20and%20add%20%22IP%20Address%22%20as%20a%20column.%20Then%20you%20can%20find%20the%20Public%20IP%20that%20you're%20looking%20for%20and%20the%20name%20of%20the%20Public%20IP.%20If%20you%20click%20on%20it%2C%20you%20can%20see%20which%20VM%20it%20is%20associated%20with.%20That%20might%20be%20a%20little%20simpler%20for%20you%20possibly%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMaybe%20on%20the%20Private%20IP%20side%20go%20to%20the%20VNet%20and%20look%20at%20the%20resources%20that%20have%20IPs%20in%20that%20VNet%3F%20Are%20you%20using%20Azure%20DNS%20or%20your%20own%20DNS%20in%20your%20Private%20network%20side%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1542581%22%20slang%3D%22en-US%22%3ERe%3A%20Is%20there%20a%20better%20way%20to%20search%20by%20IP%20address%20in%20the%20portal%3F%20Both%20Public%20%26amp%3B%20Private%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1542581%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F172255%22%20target%3D%22_blank%22%3E%40Russell%20Hackworth%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20just%20spotted%20this%20post%20and%20just%20joined%20here.%20I%20used%20this%20script%20to%20get%20all%20the%20public%20ip's%20associated%20with%20IaaS%20resources%20or%20Appliances%20in%20Azure.%20(It%20does%20not%20dump%20PaaS%20resources%20though%20so%20keep%20that%20in%20mind.%20What%20i%20mean%20is%20that%20if%20you%20allow%20a%20public%20ip%20range%20in%20one%20of%20your%20PaaS%20services%2C%20this%20script%20will%20not%20capture%20that%20information.%20I%20hope%20you%20find%20this%20useful%3A%3C%2FP%3E%3CP%3EConnect-AzAccount%3CBR%20%2F%3ESet-AzContext%20-Subscriptionid%20(Put%20your%20id%20here)%3CBR%20%2F%3E%23%20This%20gets%20all%20the%20public%20IP's%20and%20displays%20it%20on%20the%20screen%3A%3CBR%20%2F%3EGet-AzPublicIpAddress%20%7C%20select%20name%2Cipaddress%3CBR%20%2F%3E%23%20To%20pipe%20this%20out%20to%20a%20file.%20You%20can%20specify%20any%20folder%20you%20can%20access%3A%3CBR%20%2F%3EGet-AzPublicIpAddress%20%7C%20select%20name%2Cipaddress%20%7C%20export-csv%20c%3A%5Ctemp%5Cazurepublicip.csv%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20CLI%2C%20this%20command%20works%2C%20but%20it's%20ugly%3A%26nbsp%3Baz%20network%20public-ip%20list%20%5B--resource-group%5D%3CBR%20%2F%3E%5B--subscription%5D%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

I know that you can list the VM's and show the ip addresses on the VM list, but short of digging through every row finding a machine by ip is a pain.  Private connected networks, I can ping it with a name resolution to get the name to search for that, but on the public side I can't, or for servers in a different network I can't.

Thanks,

Russ

5 Replies

Are you looking for Public or Private IPs? It sounds like Public IPs. If that's the case, you can in the Portal, go to "All Services" then search for "Public IP Addresses" (which I made a favorite), then once you go to that, you can click on "Edit Columns" at the top, and add "IP Address" as a column. Then you can find the Public IP that you're looking for and the name of the Public IP. If you click on it, you can see which VM it is associated with. That might be a little simpler for you possibly?

 

Maybe on the Private IP side go to the VNet and look at the resources that have IPs in that VNet? Are you using Azure DNS or your own DNS in your Private network side?

@Russell Hackworth 

I just spotted this post and just joined here. I used this script to get all the public ip's associated with IaaS resources or Appliances in Azure. (It does not dump PaaS resources though so keep that in mind. What i mean is that if you allow a public ip range in one of your PaaS services, this script will not capture that information. I hope you find this useful:

Connect-AzAccount
Set-AzContext -Subscriptionid (Put your id here)
# This gets all the public IP's and displays it on the screen:
Get-AzPublicIpAddress | select name,ipaddress
# To pipe this out to a file. You can specify any folder you can access:
Get-AzPublicIpAddress | select name,ipaddress | export-csv c:\temp\azurepublicip.csv

 

In CLI, this command works, but it's ugly: az network public-ip list [--resource-group]
[--subscription]

Hi @Russell,

Found this post just now...

We now have a 'Virtual Machines' view on the Azure portal, which allows customizing the column order on display. The displayed list can then be saved with a name. One can switch to this saved view when needed.

I followed these steps to display the Private IP address right next to the VM Name column. Likewise, one could arrange the Public IP address column.

Hope this helps.

Thanks,
Siva
Great Script. For anyone who doesn't already know, before you can run it you have to:-

Install-Module -Name Az
Import-Module Az

@RichardA 

Here is an ARG (Azure Resource Graph) Query that might help to get you started:

// Get vmNics with IP Addresses
// Aggregation of all the vmNics by the lowercase VM id
Resources
    | where type =~ 'microsoft.compute/virtualmachines'
    | project vmId = tolower(tostring(id)), vmName = name
    | join (Resources
        | where type =~ 'microsoft.network/networkinterfaces'
        | mv-expand ipconfig=properties.ipConfigurations
        | project vmId = tolower(tostring(properties.virtualMachine.id)), privateIp = ipconfig.properties.privateIPAddress, publicIpId = tostring(ipconfig.properties.publicIPAddress.id)
        | join kind=leftouter (Resources
            | where type =~ 'microsoft.network/publicipaddresses'
            | project publicIpId = id, publicIp = properties.ipAddress
        ) on publicIpId
        | project-away publicIpId, publicIpId1
        | summarize privateIps = make_list(privateIp), publicIps = make_list(publicIp) by vmId
    ) on vmId
    | project-away vmId1
    | sort by vmName asc