PowerTip: Get the public IP of an Azure VM with PowerShell

The Scripting Guys

Dr

Summary: Use the Azure Resource Manager cmdlets to get the public IP address of an Azure virtual machine.

Hey, Scripting Guy! Question How can I get the public IP address information for an Azure Resource Manager virtual machine (VM)?

Hey, Scripting Guy! Answer 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

The Doctor

The Scripting Guys
Dr Scripto

Follow Dr   

Avatar
Simonelli, Franco D. 2019-03-07 11:23:51
Doens't work, sir.