網頁

2016/11/01

Azure虛擬機器(傳統)透過PowerShell指定固定IP


Azure portal摸了一陣子發現,原來虛擬主機要給固定IP在portal上是沒得設定的,且一定要透過powershell的指令並安裝Azure powershell模組後才能開始進行設定 ....

開啟PowerShell(需確認已安裝Azure PowerShell模組)並依序輸入以下指令,
1.
Login-AzureRmAccount

2.
Add-AzureAccount

3.
Select-AzureSubscription -SubscriptionName "Azure 开放许可"
// ""裡頭使用訂用帳戶名稱

4.
New-AzureReservedIP -ReservedIPName SmartReadingCN_reservedip -Location "East Asia"
//SmartReadingCN_reservedip為固定IP之物件名稱,""裡頭使用該台虛擬主機之所在區域

5.
Get-AzureReservedIP
//確認最終固定IP資訊

6.
Set-AzureReservedIPAssociation -ReservedIPName SmartReadingCN_reservedip -ServiceName smartreadingcn7877
//SmartReadingCN_reservedip為固定IP之物件名稱,smartreadingcn7877為虛擬機器的DNS名稱

在上述第1~3階段會有兩次需要你登入Azure帳號,務必要記得一定得登入才能繼續操作使用.

Ref.
https://azure.microsoft.com/zh-tw/documentation/articles/powershell-install-configure/

https://azure.microsoft.com/zh-tw/documentation/articles/virtual-networks-reserved-public-ip/

沒有留言:

張貼留言