Following the previous Blog My Server On Cloud (Azure) lets see how we can set Static IP address on a VM. In the last blog I stated that all the IP addresses that are assigned in Azure are done by DHCP,so how can we make an IP address be static for a VM.
Before we begin on how to set static IP let me say how to make your PowerShell work on the Azure.We have a special PowerShell for Azure and that can downloaded from Get the SDKs and command line tools you need.Scroll down to Command-Line tools and click on windows install (if you are using windows) under Azure command-line Interface.Once you install it you will see the Windows Azure PowerShell under your start menu.
Step 1: Open Windows PowerShell Azure and type in Add-AzureAccount.Type in the email address with which you have activated your license.
Step 2: Obtaining Publish Settings File.This File contains Credentials and other information that can be used on Azure.
Save the .PublishSettings file to a location and run the command
Import-AzurePublishSettingsFile <PathToFile> to import the settings file to Powershell
Step 3: Once we are done with the above Prep you can run the commands related to your DNS service name which will bring your VM details
Step 4: To set static IP to VM in this step we are making the DHCP to provide a particular IP to the VM that we specify
To stop the VM is its Running
Get-AzureVM -ServiceName DC-chris | Stop-AzureVM –Force
To set to set static IP address run the below commands
Get-AzureVM -ServiceName DC-chris -Name Chris-DC | Set-AzureStaticVNetIP -IPAddress 10.0.0.4″ | Update-AzureVM
Get-AzureVM -ServiceName DC-chirs -Name EX-CIN1 | Set-AzureStaticVNetIP -IPAddress “10.0.0.5” | Update-AzureVM
With the above Steps we can assign our machines with a Static IP..We will see in the next post as to how we can create a VM in Azure and Run our applications on it.