I’ve written in the past about how to setup WordPress on an Azure App Service and about connecting that WordPress instance to MySQL in an Azure VM. While these articles do contain some useful information about setting up WordPress and its interaction with Azure services, I’ve come to the conclusion that WordPress simply doesn’t function as nicely when hosted on IIS.
For about 1-2 years, I hosted several WordPress blogs in Azure App Services which connected to MySQL instances on an Azure VM (exactly as described in my articles above). I struggled endlessly with strange plugin issues and constant timeouts when attempting to connect to MySQL. For example:
- Certain caching plugins complained that certain settings could not be applied due to IIS
- WordPress.com and JetPack integration sometimes didn’t detect plugin and WordPress updates properly
- When attempting to update plugins from WordPress.com or JetPack, it would simply fail with no error messages
- Random and intermittent “Database connection” failures would occur even though I could guarantee the username/password/connection information was correct (especially since connections would succeed and then fail 30 seconds later)
I tried debugging these issues for months including monitoring incoming traffic on the VM to diagnose MySQL connection timeouts but was ultimately unsuccessful in determining a solution. Actually, that’s not entirely accurate. I did come up with a solution. I stopped using WordPress on Azure App Services.
So what to use then? I decided on using my existing VM to host the classic LAMP stack. It was already running Linux and MySQL, so I just had to add Apache and PHP. Hosting WordPress under this environment and technology stack has proven to be much more reliable and friendly with plugins.