I have an Azure trial account with an sql database and an asp.net 5 web app. The db server firewall has a rule for my local computer IP, and also the checkbox "Allow access to Azure service" on. I can connect from my local Sql Server Manager to the azure database without incident.
The web app has this connection string set up in its 'Application Settings/Connection strings' section. I'have checked the wep app IS using this connection string:
"Server=tcp:[MyServerName].database.windows.net,1433;Database=[MyDbName];User ID=[MyUserName]@[MyServerName];Password=[MyPassword];Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"
This same connection string is used in a desktop client and works fine. However, the web app is unable to connect to the server, and throws this exception, which is pretty clear, but I don't know how to solve.
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)
I know very similar questions have been asked and answered here, but none of them are the exact same problem I'm facing, neither have been a solution for me.
Thanks everyone for your time.
UPDATE 1
As a test, I've configured the website to run on my local IIS, against the azure DB, and it works also. So, desktop applications, sql server manager and IIS can access this database from my local computer. Of course my IP is whitelisted in the server firewall, but azure app services are whitelisted also and don't have access.
UPDATE 2
Joe Raio's comment made me double check the region configuration, and here's an screenshot of the current settings. I believe everything is correct.