0

I have a project consisting of several frontend and backend apps, and several databases; I am in the process of building the deployment pipeline. It should use Azure Static App Services for the frontends, Azure App Services for the backends (.NET 6) and Azure SQL databases.

So far one .NET6 backend app is connected to the master DB without problems. Another backend app, (Identity Server 6, deployed on the same Linux App Service Plan) which uses the same connection string as the working one, and the same configuration (HTTP2, TLS 1.2 etc) just does not want to connect to the database, and throws the following exception on startup:

Unhandled exception. Microsoft.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the login process. (provider: TCP Provider, error: 35 - An internal exception was caught)

Now of course I have read the MS documentation about that error, but all solutions (like SQL Server version too old to understand TLS version) are not applicable for SaaS offers, or can get eliminated because of the other app running on the same config is working (like .NET5+ on Linux containers has a strict cipher set).

I also tried downgrading to minimum TLS on both sides, setting TrustServerCertificate to True in the connection string, even trying to set Encryption to False (which is not allowed on Azure SQL Servers and will answer with a similar, but earlier error (error during pre-login).

Since the apps have the same configs, and the SQL Server is the same too, the issue can only lie in the app itself I guess, but shouldn't all the relevant functionality come from the .NET6 framework anyway? Microsoft.Data.SQLClient is version 4.1.0.

Deploying the app locally with connection to the Azure SQL db does work.

I am out of ideas... What are your thoughts? What assumption could be wrong, if the problem can't be where I expect it to be?

xalib
  • 1
  • 1

1 Answers1

0

After two weeks of debugging and talks with 4 Azure Support guys and entertaining every cloud engineer of two companies, we did not find a solution; the app works when deployed locally, but does not connect to the SQL Database once deployed on an Azure Web Service Linux (= a docker container), neither manually nor via CD pipeline.

The workaround is to run it on a Windows App Service, which works without problems. Windows based containers are more expensive, and should be unnecessary. But here we are.

xalib
  • 1
  • 1