I needed several VMs in Azure for testing purposes and I required a semi-stable HTTP server on each of them. Normally I give the VM a public IP, but since this was for testing purposes I did not want to waste any of my public IPs.
Azure VMs can still be accessed from the outside even without a public IP, but the IP changes during each reboot (at-least). Azure allows one to setup a DNS address for the dynamic IP to be used instead of the IP, which is awesome.
This can be done by:
- Selecting the VM’s resource group under Resource Groups in the Azure portal.
- Select the Public IP address associated with the VM.
- Select Configuration and then specify the optionally DNS name.
Depending on the location of the VM, the DNS will look something like this:
Obviously, one must choose a name which does not conflict with another DNS in the Azure cloud.