I'm trying to connect wordpress that is running on an Azure Application Service. In the main domain I have an ASP NET MVC application and I configured an application to run wordpress in the same domain. PHP is working normally because I can run files with this extension. The problem is occurring when I try to connect to a MySQL database that is not running on azure. I ran a test on my local machine (IIS) and the connection usually occurs.
Error Message
Warning: mysqli :: __ construct (): (HY000 / 2002): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in D: \ home \ site \ wwwroot \ blog \ test.php on line 20 Connection failed: A connection attempt failed because connected party did not properly respond after a period of time, or established connection failed because connected host failed respond.
Code used to test the connection
<?php
$link = new mysqli('ENDERCOIP:3306', 'USUARIO', 'SENHA', 'BANCO_DADOS');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>
I believe azure is blocking requests. Is there any configuration I can do to free the ports of MySQL?