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 , 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
Pantelis Apostolidis is a Sr. Specialist, Azure at Microsoft and a former Microsoft Azure MVP. For the last 20 years, Pantelis has been involved to major cloud projects in Greece and abroad, helping companies to adopt and deploy cloud technologies, driving business value. He is entitled to a lot of Microsoft Expert Certifications, demonstrating his proven experience in delivering high quality solutions. He is an author, blogger and he is acting as a spokesperson for conferences, workshops and webinars. He is also an active member of several communities as a moderator in azureheads.gr and autoexec.gr. Follow him on Twitter @papostolidis.