Application Service connect to Azure’s external Mysql database

Asked

Viewed 53 times

0

I’m trying to connect wordpress that is running on an App Service on Azure. In the main domain I have an ASP NET MVC application and 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 did a test on my local machine (IIS) and the connection occurs normally.

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 teste.php on line 20 Connection failed: 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.

Code used to test 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 release Mysql ports?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.