When I migrate my ASP.NET web application to a new Windows server, I got the error "Login failed for user 'IIS APPPOOL\DefaultAppPool". The database is MS SQLSERVER 2016.
The application failed to open a connection to SQL Server.
You need to add a login to SQL Server for IIS APPPOOL\DefaultAppPool and grant permissions to the database.
In SQL Server Management Studio (SSMS), under the server, expand Security, then right click Logins and select "New Login...".
In the New Login dialog, enter the app pool as the login name and click "OK".
You can then right click the login for IIS APPPOOL\DefaultAppPool, select Properties and select "User Mapping". Check the appropriate database, and the appropriate roles:
© 2021 Digcode.com