HTTP 500 ERROR SQL server gives out errors when deploying ASP.NET Web App?

  Kiến thức lập trình

I get these errors in the Application logs of Azure and I have no idea why it says site error cannot handle this request. Thank you.

[Error] Microsoft.EntityFrameworkCore.Database.Connection: An error occurred using the connection to database 'XXX' on server '(localdb)\MSSQLLocalDB'.
 [Error] Microsoft.EntityFrameworkCore.Query: An exception occurred while iterating over the results of a query for context type 'XXX.Models.SiteContext'.Microsoft.Data.SqlClient.SqlException (0x80131904): 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: SNI_PN11, error: 52 - Unable to locate a Local Database Runtime installation. Verify that SQL Server Express is properly installed and that the Local Database Runtime feature is enabled.)

I have tried everything to ensuring in SSMS that the remote connections are allowed, to adding the connection string into the configuration tab of the app service. My connection string is only in secrets.json. I have peered into everything on Stack Overflow and tried everything and still cannot resolve this.

New contributor

David Cooper is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

LEAVE A COMMENT