Abhishek Sharma
Abhishek Sharma

Reputation: 109

What is the correct way to set up a web server hosting a web site with an Azure VM?

I have a small web page that I am currently using an Azure Linux VM running nginx to host. The domain name itself is managed by google domains, but I've set it to use azure endpoints for domain name resolution. I have created a DNS zone for the website and added A & AAAA * records that resolve to the IP address of the VM I have created.

The problem is that the Azure VM I have set up randomly fails-over to a new IP-address. And this isn't a rare occurrence - it seems to happen once every couple of weeks. This is causing my web site to go down randomly because the Azure DNS servers no longer resolve the domain name to the correct IP address. I have no idea why this happens and googling the phenomenon seems to yield no actionable results.

Is there something that I'm missing here? What's the correct way to set up a VM-backed web site?

Upvotes: 0

Views: 95

Answers (1)

Radoslaw Wiankowski
Radoslaw Wiankowski

Reputation: 96

I would suspect that the public IP which is assigned to your VM is configured as dynamically allocated. If that is the case, change it to "Static" and you shouldn't be facing the problem any more. For reference see the attached screenshot.

screenshot

As a side note - have you considered using App Service? It might turn out more cost effective.

Upvotes: 1

Related Questions