I'm trying to get a website hosted on Azure IaaS VM to communicate with a database hosted on Azure PaaS SQL. However, I am receiving an exception when trying to connect:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
From the VM itself, I can connect using SSMS to the server in question using its [name].database.windows.net host name with multiple users/passwords (copy/pasted from KeePass).
From the web app, the connection is configured using a connection string in a web.config. The connection string was copied/pasted from the Azure Portal and modified to contain the username and password (also copied/pasted from KeePass). As an additional test, I copied/pasted the connection string into the "Additional Connection Parameters" tab in SSMS's "Connect to Server" dialog, and was able to connect that way as well.
This is an "inside" to "inside" communication (https://docs.microsoft.com/en-us/azure/sql-database/sql-database-develop-direct-route-ports-adonet-v12) and I added an allow rule in the Windows Firewall on the VM for the outbound transient SQL ports.
Can anyone suggest something that I may be overlooking to get this to work?