Microsoft Azure by default has a dynamic assignment of a public IP address to a newly-created VM unless we change it to be static. Public IP enables communication to Azure VM from the internet. Assigning a static public IP address ensures that the address never changes as opposed to the dynamic public IP address. The dynamic IP address changes every time we restart the Azure VM
Assign Static Public IP address to VM during the creation
You could do this when you create the vm under
- Login to MS Azure portal
- Click “Virtual Machines” from the left menu.
- Click “Add”.
- Add the basic information about the virtual machine to be set up.
- In the Networking tab, for Public IP click “Create new”.
- Under assign, select Static.
- Click OK.
Add Static Public IP to an existing Azure VM
If you already have a Public IP, here is how to alter it to either static or dynamic on the NIC.
Click IP configuration (e.g. ipconfig1).
Under Public IP address settings, for Public IP address click Enabled.
Click “IP address”.
Click “Create New”.
Under Assignment, select Static