2016-11-26 91 views
0

我正嘗試獲取在ARM模型的預訂中分配給資源的保留IP的列表。Azure powershell命令獲取訂閱中虛擬機的保留IP詳細信息

Get-AzureReservedIP命令不起作用,表示未選擇默認預訂。不過,我選擇了默認訂閱,但仍然無法使用該命令。

這裏是片段

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

有什麼建議?

+1

爲ARM。 – evilSnobu

回答

1

Azure的部署有兩種方式:Azure的服務管理(ASM)和Azure的資源管理器(ARM)。

您使用ARM模式登錄,「Get-AzureReservedIP」是ASM命令。在ARM中,保留的IP地址稱爲靜態公共IP地址。爲了得到它們,請運行下面的命令:

Add-AzureRmAccount 

$subName="subscriptioname" 

Select-AzureRmSubscription -SubscriptionName $subName 

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

如果你想在ASM模式的保留IP地址,請運行下面的命令:我認爲這是'GET-AzureRmPublicIpAddress`

Add-AzureAccount 

$subName="subscriptioname" 

Select-AzureSubscription -SubscriptionName $subName -Current 

Get-AzureReservedIP 
1

你可以試試: Get-AzureRmNetworkInterface -Name TestNIC -ResourceGroupName TestRG