You cannot tell user or Search Engine to use Public IP to access your site. Plus, Public IP changes unless you pay extra bucks to get static Public IP.
To add custom domain to your Azure VM, you must have an idea of CNAME and A record.
As Public IP changes and we had to spend some money to get static Public IP, so I’m using CNAME here instead of A record.
From yor Resource Group in, which your VM is sitting, choose Public IP > Settings > Configuration choose available DNS Name Label.
So, now your DNS name label will be ChoseName.VMLocation.cloudapp.azure.com. Meaning, you can access your website using this URL. Now, you have to align your custom domain with this DNS name label.
Now, go to your DNS provider site and manage DNS settings. In my case, it is NameCheap.
Fill the feilds as followed (according to your DNS name label)
Save the DNS settings and you’re all set!
Now you can access your VM using your custom domain name.
Got questions? Feel free to ask ’em in comments.