I published a Blazor (Server side) application with Windows Authentication to IIS. I disabled "Anonymous Authentication" and enabled "Windows Authentication".
The application can display the login information ("Hello, Domain\Username!") correctly. The application connects to SQL Server using Windows integrate mode.
"ConnectionStrings": {
"MyDatabase": "Server=DBServer;Database=DB1;Trusted_Connection=True"
}
However, it uses the system account (which is used to run IIS?) to connect the SQL Server.
Login failed for user 'Domain\IISMachineName$'.
I tried to enable "ASP.NET Impersonation" for the IIS site and it gets the 500.24 error.
HTTP Error 500.24 - Internal Server Error
An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.
Most likely causes:
• system.web/identity@impersonate is set to true.
It depends on your hosting and the location of your SQL server, as you say you host in IIS it takes the application pool like any other webservice hosted in IIS.
If SQL Server is on the same server then you can assign the application pool. You can add the application pool to your SQL Database as a Login and user.
On a different machine you can simply create the machine hosting your blazor app as a user.