Please verify that the FQDN of the on-premises database server is resolving to private IP from within the app service. To do this, navigate to the app service in the portal, Development tools -- Advanced tools blade -- click Go. When Kudu site opens, click Debug console -- CMD. In the command prompt, enter command similar to below:
The output should should show the private IP address of the database server, not public IP. If it shows public IP then you need to make some changes to DNS configuration. Exact changes are going to depend on your specific environment and needs. If you post output of nameresolver and provide details on environment I can recommend what changes need to be made.
Please click Accept Answer if the above was helpful.