I am building a .NET app that is just endpoints for front end to access a database that is in Azure SQL Database. Locally it runs without problems, connecting to the Azure SQL Database with a connection string.
When I try to host it in an Azure App Service I use a managed Identity for the App Service to authenticate. Then I got the SQL-Exception “Login failed for user ”” discussed here.
When I did as discussed there and added a user for my App-Service to the database. I instead just get
“This page isn’t working” when trying to access the page of the App-Service. And in console: “Failed to load resource: the server responded with a status of 500 ()”
Even if I remove the user again from my database the problem remains. But if I create a new database and point to that. I am back at “Login failed for user ””.
What can be the cause of this and why can’t I see a detailed error message even if I have set
ASPNETCORE_DETAILEDERRORS to true as environment variable.
I have set the “Allow access to Azure services” to allow it.