Adding to Lex Li's suggestions, based on my understanding of your scenario, after VNET disconnect/reconnect the app connects to the database server successful.
To isolate the issue, why you might be experiencing intermittent connection errors between your Azure app service and the database server.
--One of the reasons could be that you are hitting a limit while making new outbound connections. The limits you can hit include : TCP connections and SNAT ports.
TCP connections: There's a limit on the number of outbound connections that can be made.
SNAT ports are used to communicate with public IP addresses. Each instance on Azure App service is initially given a pre-allocated number of 128 SNAT ports. When app rapidly open a new connection, they can quickly exhaust their pre-allocated quota of the 128 ports. They are then blocked until a new SNAT port becomes available, either through dynamically allocating additional SNAT ports, or through reuse of a reclaimed SNAT port. If your app runs out of SNAT ports, it will have intermittent outbound connectivity issues.
--You may always leverage App Service diagnostics from Azure Portal> Navigate to your App Service app in the Azure Portal.
In the left navigation, click on Diagnose and solve problems
- Review and run – Network troubleshooter and ““Configuration and Management” (IP address configuration)
--Service Health keeps you informed about the health of your environment. Kindly review Service Health check alerts.
Ref: Please take a look at the doc to troubleshoot intermittent outbound connection errors in Azure App Service.
Kindly let us know, I'll follow-up with you further.