Connection between App Service (Web App) and MySQL Database

Nathan88 0 Reputation points
2023-11-17T16:17:41.44+00:00

Hi everyone,

The connection between our App Service (Web App) and Azure Database for MySQL has always been based on "Public Access", by whitelisting IP's on the Azure Database MySQL firewall.

Recently, we disabled Public Access on the Azure Database MySQL, and created a Private Endpoint, which we integrated with a Private DNS Zone.
The Private Endpoint has been linked to the same VNet as the VNet of the App Service.

On the App Service under the "Networking" section, we enabled VNet integration.

Basically, the Azure Database MySQL can only be reached through the Web App now.
However, I am unable to reach the Database MySQL server through the Web App.

In the Web App configuration I added the following Application Settings:
AZURE_MYSQL_HOST - Server name of the MySQL server
AZURE_MYSQL_DBNAME - Name of the database that I added
AZURE_MYSQL_USERNAME - User name
AZURE_MYSQL_PASSWORD - Pass word
AZURE_MYSQL_PORT - 3306
AZURE_MYSQL_FLAG - MYSQLI_CLIENT_SSL

Is there anything that I still have to do?
As far as I know, no NSG's have been configured/connected.

Thank you!

Azure Database for MySQL
Azure Database for MySQL
An Azure managed MySQL database service for app development and deployment.
986 questions
Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
1,173 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Ryan Hill 30,281 Reputation points Microsoft Employee Moderator
    2023-11-18T23:10:54.7866667+00:00

    Hey @Nathan88

    I assume you're using the database server's fully qualified domain name (FQDN) <servername>.mysql.database.azure.com in your AZURE_MYSQL_HOST. When you created the private link, there should've been a DNS CNAME record that resolves the FQDN to private link endpoint, so that's the first thing I would check.

    If the DNS records are correct, then you can review this troubleshooting guide to help isolate the issue for your configuration. The Diagnose and solve problems blade has a Network troubleshooter that essentially follows this guide that you can use to assist you. If you aren't able to resolve your issue after reviewing the guide, please share any errors you received post troubleshooting.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.