I have deployed asp.net core 2.2 web app as a WebSite to IIS. I've set the application pool identity to ApplicationPoolIdentity:
[
I can see that System.Security.Principal.WindowsIdentity.GetCurrent()
returns
IIS APPPOOL\MyCustomAppPool
But when I try to connect to SQL Server using connection string:
Server=localhost;Database=MyDadatabse;Trusted_Connection=True;
I get following error (ignore the german):
SqlException: Fehler bei der Anmeldung für den Benutzer "CompanyDomain\ComputerName$".
Why it is not using the ApplicationPool identity?
Also note, that when I set custom username/password as the identity for application pool, it works.