Jul 01 2024 10:41 AM
Hello all,
I finally convinced to write here after an hour of pointless searching.
I have an App written in .net framework, that uses MysqlConnector to connect to external database, hosted on Aiven.
The app does not work in Azure App service, since it complains that it cannot connect to the database.
The documentation tells about configuring Vnet I'm order to open the necessary tcp ports for the app to connect to the external database. Is this really necessary? App network configuration reports there's no limitations.
Thanks
Jul 16 2024 06:10 AM
Hey @johnnyontheweb,
You've run into a common issue when trying to connect an Azure App Service to an external MySQL database. Here's the main thing: Azure App Services operate in a sandbox environment with limited networking capabilities by default.
To connect to an external MySQL database, especially one hosted on Aiven, you typically need to ensure that your app can reach the database server over the network.
Here’s a step-by-step approach to solve your issue:
VNet Integration:
Network Security Rules:
Database Configuration:
Connection String:
App Service Settings:
Logging and Diagnostics:
By integrating your Azure App Service with a VNet and ensuring the correct network configurations, you should be able to resolve the connectivity issue with your Aiven-hosted MySQL database. If there are still problems, detailed error logs will help pinpoint the exact issue.
If you need more help, feel free to ask!
Cheers!