azure, virtual machines

Assigning a Static IP Address on an Azure VM

Quick tip: if you need to set a static IP address on a VM running in Azure you can use the following snippets at the Azure Powershell:

# Determine whether the target IP address is in use on Virtual Network "SPnet"
Test-AzureStaticVNetIP –VNetName SPnet –IPAddress

# Give machine "sp1" running on azure service "XXX" a static IP address of
# Note that I had the VM switched off when I did this. I'm not clear on whether that's necessary -  the machine may need a reboot if its on
Get-AzureVM -ServiceName XXX -Name sp1 | Set-AzureStaticVNetIP -IPAddress | Update-AzureVM

I’m not actually sure if it’s possible to just switch DHCP off on the machine directly. It occurs to me that it might work, but because the azure network infrastructure won’t know that machine is bagging it’s own IPs, it might get upset.


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