Set a static IP address for Windows Azure VM

6 בApril 2014

אין תגובות
Hello All

As you already know one of the most common issues that we faced using Windows Azure was that we cannot set a static IP for virtual machine, instead we obtain an IP address from the Azure DHCP (depending on the network subnet that you configure the virtual machine to use)

.In the last release of Azure PowerShell we got a new command that help us solve this issue

The command name is: Set-AzureStaticVNetIP

.This command basically create a reservation of the IP address to be set only to the specific VM

?How does it works

Please download the latest PowerShell CMDLET from here

Then you should close your virtual machines because they already got an IP address assigned to them and you cannot configure static IP while they up

Get-AzureVM –ServiceName <CSName> | Stop-AzureVM –Force

Please change <CSName> with your cloud service name*

:Get-AzureVM -ServiceName <CSName> -Name <VM Name> | Set-AzureStaticVNetIP -IPAddress <Desired IP> | Update-AzureVM

?What to do in case I want to remove the reservation

:Well, this one is almost the same as before but instead of Set-AzureStaticVNetIP we need to use Remove-AzureStaticVNETIP like this

Get-AzureVM -ServiceName <CSName> -Name <VM Name> | Remove-AzureStaticVNETIP | Update-AzureVM

That’s it, good luck

Ido Katz

Senior Infrastructure Consultant

Agile IT Solutions

הוסף תגובה
facebook linkedin twitter email

Leave a Reply

Your email address will not be published. Required fields are marked *