In this post let us have a quick look at how to configure private and public IP addresses as static.
Setting Static Private IP Address:
As we know in Azure it is the network interface card associated with the VMs that get IP addresses, the default dynamic IPs can be changed to static.
As shown in the below image navigate to the networking section of the virtual machine to identify the network interface card(s) associated and move to network interface card settings by selecting the network interface card.
Select IP Configurations option to see the private IPs as highlighted below.
Select the IP configuration, in this case, ipconfig1 to see the below screen where you can change private IP to static as shown in the below images.
If required change the private IP address that is currently assigned and click the Save option to save the settings
Once the settings are updated you see the private IP address shown as Static.
Setting Static Public IP Address:
Like private IPs, we can set the dynamic(default) public IPs addresses assigned to the network interface to static on the Public IP address (which is a seperate resouce associated to network interface card of the VM)
As shown in the below image to change the assignment state to static select the Public IP address assigned to the VM.
Change the assignment from dynamic to static
Save the settings and reboot the server that is associated with the public IP to reflect the changes.