RpB
RpB

Reputation: 315

Azure powershell command to get the reserved IP details for a VM in a subscription

I am trying to get the list of reserved IP's that are assigned to resources in my subscriptions in ARM model.

Get-AzureReservedIP command does not work saying the default subscription is not selected. However I selected a default subscription and still the command does not work.

here is the snippet

Add-AzureRmAccount
$subName="subscriptioname"
Select-AzureSubscription -SubscriptionName $subName -Current
Get-AzureReservedIP

Any Suggestions?

Upvotes: 0

Views: 998

Answers (2)

Steven Lee - MSFT
Steven Lee - MSFT

Reputation: 810

Azure has two ways of deployment: Azure service management (ASM) and Azure resource manager (ARM).

You sign in with ARM mode and the "Get-AzureReservedIP" is a ASM command. In ARM, the reserved IP address is called static public IP address. To get them, please run the commands below:

Add-AzureRmAccount

$subName="subscriptioname"

Select-AzureRmSubscription -SubscriptionName $subName

Get-AzureRmPublicIpAddress | Where-Object { $_.PublicIpAllocationMethod -eq "Static" }

If you want to get the reserved IP address in ASM mode, please run the commands below:

Add-AzureAccount

$subName="subscriptioname"

Select-AzureSubscription -SubscriptionName $subName -Current

Get-AzureReservedIP

Upvotes: 1

Amr Reda
Amr Reda

Reputation: 662

You can try : Get-AzureRmNetworkInterface -Name TestNIC -ResourceGroupName TestRG

Upvotes: 1

Related Questions