Skip to content

Using Fixed IP in Virtual Machines on Windows Azure


A new feature that became available in new versions of PowerShell for Windows Azure are the commands "StaticVNetIP". You can download the new version at #cmd-tools

These commands allow you to attach the IP within the range of virtual network that you have already defined, thus allowing can ensure the IP of each VM without the need to make the "Start" in the fixed order every time.

Step 1: know the risks and Manage Their IPs

Before we begin, it is important to note that there is support if problems arise (

"Use DHCP-leased addresses (this is mandatory — static addresses are NOT supported)

Therefore, before you begin to designate fixed IPs their VMs, remember to keep a list of IPs defined!

In addition, do not use IPs that are not in the range of your virtual network. For example, my network has the range to 254 and if I fix the IP to a VM, it will be incommunicado and need to be excluded.



Step 2: Register the Signature in PowerSell

This step is permanent, and simply run the command Add-AzureAccount which will open a window of authentication and import the data from your signature:


To verify that imported successfully use the command Get-AzureSubscription that returns the registered data:


If you need to remove a subscription that has used in the past to test the command Remove-AzureSubscription is indicated. If necessary, you will need to reset your default signature, the command below will reset the default:



Step 3: Register the IP of Each VM

To register the IPs remember what was commented at the beginning, it is necessary that they are in the range of virtual network that you have defined, otherwise the VM can no longer be accessed and will be incommunicado.

The command you use to secure the IP does not work with strings, the first step is to use the command Get-AzureVM to return in a variable the PermanentID the VM you want:


The above command searches for the VM "W2012-Exch-3" in the catalog and returns the ID, and the command Set-AzureStaticVNetIP below the fixed IP:


Note: you can use the "pipe |" to run the commands on the same line if desired

However, note that the above command was not confirmed, just like that. The correct way is to use the Update-AzureVM in sequence to confirm the change, as a commit.

Thus, the sequence of commands to change the VMs would have been like the example below:


Note that in this example 3 different VMs have had their fixed and IPs is possible with the command Get-AzureStaticVNetIP see if the VM set the desired IP:


Finally, while checking the network scope in Azure, you can see that the machines were fixed IP resumed:


  1. Quality articles is the main to be a focus for the people to go to see the web page, that’s what this website is providing.

  2. Great items from you, man. I’ve keep in mind your stuff prior
    to and you’re simply too great. I actually like what you have got right
    here, really like what you’re stating and the best way
    wherein you assert it. You are making it enjoyable and you still care
    for to stay it sensible. I can not wait to read far more from you.
    That is actually a wonderful web site.

  3. Have you ever thought about creating an ebook or guest authoring on other websites?
    I have a blog based on the same topics you discuss and
    would love to have you share some stories/information.
    I know my audience would value your work. If you are even remotely interested,
    feel free to send me an email.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: