Azure App service: phpMyAdmin on MySQL in App is not accesible
Introduction:
While running a Wordpress on Azure (webapp + MySQL in App) and recently ran into an issue accessing the database. Due to the increased amount of traffic coming into the app had to scale out the application.
That said, the "MySQL in App" was replicated, so 2 instances were running but not accessible from the Wordpress app and the App Settings where updated in the wrong way.
Troubleshooting
Noticed that when accessing PHPMyAdmin I was getting two instances to choose to connect from. Therefore the app couldn´t stablish communication through the right database.
Solution
Removed the application setting for MySQL which was causing this issue and that fixed the issue.
Is not advisable to scale out when you use MySQL in app. Instead you can use Azure DB for MySQL if want to scale out. There is an option to easily migrate from "MySQL in App" to "Azure Database for MySQL"
Next Steps
Recommended documents for Azure DB for MySQL.
- https://docs.microsoft.com/en-us/azure/mysql/quickstart-create-mysql-server-database-using-azure-por...
- https://docs.microsoft.com/en-us/azure/mysql/concepts-pricing-tiers
- https://azure.microsoft.com/en-in/blog/scaling-out-read-workloads-in-azure-database-for-mysql/