Check how the App Server resolves the FQDN of the Azure SQL Server. To perform this check, we need to open Console access of the App Service and run command nameresolver <azure-sql-server-fqdn>.
Once you create the private endpoint, the Azure SQL uses a private IP address, It no longer has a public IP address. Are you trying to connect with that private IP address?
Once the private endpoint has been created, you need to enable the virtual network integration in the App Service. Once we open the desired App Service, in the left pane under the settings, we can find Networking.
When we open the Networking section, the first option to configure is VNet Integration. The process is straightforward and just need to select an appropriate virtual network and empty subnet. Then, we just need to add two parameters more in the App Service configuration to have a fully functional App Service. By default, App Service routes only RFC1918 traffic into your VNet and cannot work with the Azure DNS Private Zones. If we want to route all of your outbound traffic into your VNet and use the Azure DNS Private Zones, we need to add the following settings in App Service configuration:
- WEBSITE_DNS_SERVER with value 168.63.129.16
- WEBSITE_VNET_ROUTE_ALL with value 1
Once you have implemented those changes, you can disable public access to the Azure SQL Server, by setting Deny public network access on YES and Allow Azure services and resources to access this server to NO. Now, you can run the command nameresolver <azure-sql-server-fqdn> from App Service console again, to see what result will be.
The App Service should now communicates with the Azure SQL Server using the private IP address, assigned to the Azure SQL Server as a private endpoint.
To my knowledge, you need a PremiumV2-tier or higher app service as requirement.