PowerTip: Get the public IP of an Azure VM with PowerShell
Summary: Use the Azure Resource Manager cmdlets to get the public IP address of an Azure virtual machine.
How can I get the public IP address information for an Azure Resource Manager virtual machine (VM)?
All you need to do is use Get-AzureRmVm to find the VM and pass it to Get-AzureRmPublicIPAddress as in the following example:
Get-AzureRmVM -ResourceGroupName ‘HSG-ResourceGroup’ -Name ‘HSG-LinuxVM’ | Get-AzureRmPublicIpAddress