How can I find all public facing IP addresses in Azure? or What's the best way to find all public fac

14 Replies, 1214 Views

"Hey folks!

Struggling to find all public facing ip addresses in azure for an audit. I know there's gotta be an easier way than clicking through every resource manually, right?

Tried the Azure CLI a bit but not sure if I'm missing something. Anyone got a solid script or tool that can help me find all public facing ip addresses in azure without pulling my hair out?

Also, does this include stuff like load balancers, app gateways, etc.? Or just standalone public IPs?

Thanks in advance—y'all are lifesavers! 🚀"

*(P.S. If there's a sneaky portal trick I don't know about, spill the beans!)*
Hey! I feel your pain—manually checking each resource is a nightmare.

You can use Azure Resource Graph Explorer for this. Just run a KQL query like:
`where type =~ 'microsoft.network/publicipaddresses'`

This will list all public IPs, including those attached to LBs, app gateways, etc.

For CLI, `az network public-ip list` works too, but Graph Explorer is way faster.

Hope that helps!
omg yes, the struggle is real.

I wrote a PowerShell script last month to find all public facing ip addresses in azure. It grabs everything—standalone IPs, load balancers, even VMs with public NICs.

Here’s the gist:
https://gist.github.com/randomuser/azure-ips (fake link, but you get the idea)

Also, don’t forget NAT gateways! They’re sneaky and easy to miss.
If you’re into Azure CLI, this one-liner might save you:

```az network public-ip list --query "[].{Name:name, IP:ipAddress, ResourceGroup:resourceGroup}" -o table```

It’s not perfect, but it’s a quick dump of all public IPs.

For a deeper audit, check out Azure Policy—you can enforce rules to track public IPs automatically.
Dude, just use Azure Network Watcher.

It has a "Topology" feature that visually shows all public-facing resources, including IPs, LBs, and app gateways. Super handy for audits.

Also, third-party tools like CloudSploit can scan your Azure env for public IPs and security risks.
Pro tip: Azure Resource Graph + KQL is your best friend here.

Run this query in the portal:
```Resources | where type == 'microsoft.network/publicipaddresses' | project name, ipAddress, resourceGroup```

It’ll spit out all public IPs, no clicking required.

Load balancers and app gateways will show up too since they use public IPs under the hood.
Not sure if you’ve tried it, but Azure Policy can help automate this.

Create a custom policy to audit all public IPs and report non-compliant resources. Saves you from manual checks forever.

Also, +1 for Azure CLI—`az network public-ip list` is solid, but it won’t catch *everything* (like some PaaS services).
Wow, thanks everyone! Didn’t expect so many great options.

Tried the KQL query in Resource Graph—worked like a charm! Found a bunch of IPs I totally missed.

Gonna check out that PowerShell script too.

Quick follow-up: Anyone know if this covers Azure Firewall public IPs? Or do those need a separate query?

Y’all rock! 🚀



Users browsing this thread: 1 Guest(s)