Can't connect to Azure Database for MySQL server

Posted on Posted in Azure, MySQL

ClearDB is killing off the free micro-tiers of MySQL. Like many MSDN sub­scribers with Word­Press sites (I'm guess­ing), I chose to migrate my blog data­base to Azure Data­base for MySQL serv­er, which would con­sume Azure cred­it instead of my cred­it card. After mov­ing the data­base over and point­ing my blog to it, I received the dread­ed Error estab­lish­ing a data­base con­nec­tion page.

Brows­ing to /wp-admin on my site con­firmed it was point­ing to the cor­rect data­base. I con­firmed authen­ti­ca­tion cre­den­tials were valid, but the App Ser­vice could not connect.

No IPs allowed initially

Azure SQL data­bas­es are ini­tial­ly pro­vi­sioned to allow Azure resources through the fire­wall. The fire­wall will not block any­thing orig­i­nat­ing from the IP range of Azure's datacenters.

This is not the case for Azure Data­base for MySQL serv­er. In fact, the fea­ture is not yet avail­able to enable (sup­pos­ed­ly it's com­ing soon though), so you will need to man­u­al­ly unblock the IP of your App Ser­vice (or more like­ly, a larg­er IP range in case the IP address changes). As usu­al, Microsoft Docs has great step-by-step instruc­tions on con­fig­ur­ing the fire­wall.

Leave a Reply

Your email address will not be published. Required fields are marked *