I've been successfully connecting remotely from SQL Server Management Studio 2018 to a basic Azure SQL database for a long time, but I am now getting an error when attempting to connect.
I'm developing an ASP.NET Razor pages app that has also been able to connect fine but now the Razor App is no longer able to connect. Both SSMS and the Razor Page app are receiving the same error below. Once I deploy the Razor Page app to an App Service in Azure it functions fine.
Microsoft Visual Studio Community 2022 (64-bit) - Current Version 17.6.4
Microsoft .NET Framework version 4.8.04084
Here's what I've done:
Confirmed my local IP address is allowing connections in Azure SQL to the server/database in question.
Upgraded my installation of SQL Server Management Studio to version 19
Converted the database from Basic to Standard and back to Basic
Confirmed that my instance of SQL Server Management Studio can connect to other databases in Azure SQL
I've adjusted the connection time out from 15 seconds 60 seconds
Ran an existing Minimal API application locally connecting to an Azure SQL database without any issue.
Executed queries fine against the database using the Query Editor within the Azure Portal.
Here's the error I am consistently receiving:
Cannot connect to XXXXXXX.database.windows.net.
Connection Timeout Expired. The timeout period elapsed during the post-login phase. The connection could have timed out while waiting for server to complete the login process and respond; Or it could have timed out while attempting to create multiple active connections. The duration spent while attempting to connect to this server was - [Pre-Login] initialization=194; handshake=253; [Login] initialization=5; authentication=4; [Post-Login] complete=59719; (Framework Microsoft SqlClient Data Provider)
Additionally, connecting from a console application to the same database returns the following message after
Database 'YYYYYYYYY' on server 'XXXXXXXX.database.windows.net' is not currently available. Please retry the connection later. If the problem persists, contact customer support, and provide them the session tracing ID of '{BB3A4D62-2AB4-4481-8222-FD705A45137E}'.