To set up internal static IP it is required to install Azure PowerShell in the local machine. Downloads available here.
Install Azure PowerShell.
![19 19](http://lh4.ggpht.com/-zQVskxU4Yxw/VRgLXHQL3fI/AAAAAAAAEMU/-XxbfB5Btjk/19_thumb%25255B1%25255D.png?imgmax=800)
Web Platform Installer will download and install Microsoft Azure PowerShell with Azure SDK.
![20 20](http://lh4.ggpht.com/-UOoIRAdqL2k/VRgLaRGWnaI/AAAAAAAAEMk/qRa4KhWwrpQ/20_thumb%25255B1%25255D.png?imgmax=800)
![21 21](http://lh4.ggpht.com/-FYi_kjft3d0/VRgLdsbNFvI/AAAAAAAAEM0/8Vr4m-EANXc/21_thumb%25255B4%25255D.png?imgmax=800)
![22 22](http://lh6.ggpht.com/-MsaCbLtBkvw/VRgLgLUx93I/AAAAAAAAENE/Md1nkYvaDaw/22_thumb%25255B5%25255D.png?imgmax=800)
Installation of Azure PowerShell completed.
![23 23](http://lh3.ggpht.com/-kQqzWj_O16w/VRgLij2QL1I/AAAAAAAAENU/WcTA_zc1oJE/23_thumb%25255B1%25255D.png?imgmax=800)
Launch Azure PoweShell.
![24 24](http://lh3.ggpht.com/-GFkOHrv5x9E/VRgLkkegkII/AAAAAAAAENk/1tGtX7GYqW8/24_thumb%25255B1%25255D.png?imgmax=800)
Test IP address availability in Azure Virtual Network with following command.
Test-AzureStaticVNetIP –VNetName VirtualNetworkName –IPAddress IP
Example
Test-AzureStaticVNetIP –VNetName chaminda.vn –IPAddress 10.0.0.4
This throw an exception if the Azure Subscription Account is not added in Azure PowerShell. To add Azure Account execute “Add-AzureAccount” command.
![27 27](http://lh3.ggpht.com/-lbht1aWsw8I/VRgLm2ufZgI/AAAAAAAAEN0/kAkFLw2vTCw/27_thumb%25255B1%25255D.png?imgmax=800)
Sign in.
![28 28](http://lh5.ggpht.com/-71AsyqInQGo/VRgLo0Q1dQI/AAAAAAAAEOE/ZF2-UPOEBKk/28_thumb%25255B1%25255D.png?imgmax=800)
Subscription account will be added.
![29 29](http://lh3.ggpht.com/-6Qk6XZ3_YU4/VRgLrfxVBiI/AAAAAAAAEOU/leMyxBvi1Z8/29_thumb%25255B4%25255D.png?imgmax=800)
If required to change azure subscription name before adding the account follow the instructions available here.
Execution of Test-AzureStaticVNetIP succeeds after adding the account. It shows specified IP is available or not and available few IPs to use.
![30 30](http://lh6.ggpht.com/-MBpeN08z_4k/VRgLt41-1PI/AAAAAAAAEOk/e3AhZzOUXao/30_thumb%25255B1%25255D.png?imgmax=800)
To set an static internal IP for Azure VM execute below command.
Get-AzureVM -ServiceName CloudServiceName -Name VMName | Set-AzureStaticVNetIP -IPAddress IPAddress | Update-AzureVM
Example
Get-AzureVM -ServiceName ch-dc1 -Name ch-dc1 | Set-AzureStaticVNetIP -IPAddress 10.0.0.5 | Update-AzureVM
![26 26](http://lh3.ggpht.com/-3C0l1Aok7Xs/VRgLwRW9SuI/AAAAAAAAEO0/mBcQWVgdF8A/26_thumb%25255B2%25255D.png?imgmax=800)
![31 31](http://lh5.ggpht.com/-Aam1JgoVFEI/VRgLyYS3EsI/AAAAAAAAEPE/DhYtngViX3k/31_thumb%25255B1%25255D.png?imgmax=800)
This will set specified internal IP to the VM.
![33 33](http://lh3.ggpht.com/-TUHiXmbrnt4/VRgL08OTYXI/AAAAAAAAEPU/IwHpq2oIgWI/33_thumb%25255B5%25255D.png?imgmax=800)
No comments:
Post a Comment