简体   繁体   中英

Azure: which of my cloud services has a specific IP address?

We have a rogue Azure cloud service which is hammering one of our services.

We know its IP address, but how can we find out the name of the cloud service (ie the resource group), given its IP address?

Assuming you have RM deployments in azure since you asked for resource group.

If what you have is a public IP address

Get-AzureRmPublicIpAddress | Where-Object {$_.IpAddress -eq "0.0.0.0"}

If what you have is a private IP address

Get-AzureRmNetworkInterface | Where-Object {$_.IpConfigurations.PrivateIpAddress -eq "0.0.0.0"}

If you have classic deployment, these two should help you:

Get-AzureVM | Where-Object{$_.IpAddress -eq "0.0.0.0"}
Get-AzureVM | Where-Object{$_.PublicIPAddress -eq "0.0.0.0"}

If what you have is something classic deployment but not a VM. This is the closest solution I can come up so far. It finds you the rogue cloud service BUT also returns an error for each cloud service don't have a matching IP and takes about 20s to scan each cloud service.

Get-AzureService | ForEach-Object {Get-AzureDeployment -ServiceName $_.ServiceName | Where-Object {$_.VirtualIPs.Address -like "0.0.0.0"}}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM