Jump to content













Photo
- - - - -

Set Static Private IP to an Azure VM

Posted by Pantelis Apostolidis , in Azure 19 December 2014 · 644 views

azure powershell

First of all, the VM must be within a virtual network to be able to add a static Private IP address

 

There are two ways to set a static private IP. One is using the new Azure Portal "portal.azure.com" and one via PowerShell.

 

Using the new Portal, browse a VM, select settings and then IP addresses. There at the Private IP address you can select "Static" and add the IP address.

 

Using PowerShell, first connect to the Azure (details on this post), and use the following commands:

 

#Test IP availability:
Test-AzureStaticVNetIP -VNetName XXXXXXX -IPAddress

 

#Set the VM that will take the static IP
$static = Get-AzureVM -ServiceName xxxxx -Name xxxxxx

 

#Set the static IP
Set-AzureStaticVNetIP -VM $static -IPAddress xx.xx.xx.xx | Update-AzureVM

 

#Check the static IP
Get-AzureStaticVNetIP -VM $staticVM

 

source: http://www.e-apostol...ip-to-azure-vm/