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-apostolidis.gr/microsoft/set-static-ip-to-azure-vm/
0 Comments
Recommended Comments
There are no comments to display.