On Windows10
Error: The login failed.\r\nLogin failed for user 'IIS APPPOOL\\xxx'."
on Server 2012R2
Error: System.Data.Entity.Core.EntityClient.EntityConnection.Open(); Entity Framework Exception “The underlying provider failed on Open
For a local SQL Server:
- Open SQL Server Management Studio (SSMS) and connect to the SQL Server.
- Open the Security folder at the server level and not the security folder for the database.
- Right click on the logins and select New Login.
- For the login, type IIS APPPOOL\AppPoolName and DO NOT CLICK SEARCH and select OK (If a search is executed, it will resolve to an account with ServerName\AppPool Name and SQL will be unable to resolve the account’s SID since it is virtual)
- User MappingPage>Select Database > Set User IIS APPPOOL\AppPoolName; setDefault Schema> dbOwner
- Select the defaults for the account and select OK to close dialog
CREATE LOGIN [IIS APPPOOL\AuthTest] FROM WINDOWS;
CREATE USER AuthTest FOR LOGIN [IIS APPPOOL\AuthTest];
For a remote SQL Server:
- Open SQL Server Management Studio (SSMS) and connect to the SQL Server.
- Open the Security folder at the server level and not the security folder for the database.
- Right click on the logins and select New Login.
- For the login, type Domain\ServerName$ and DO NOT CLICK SEARCH
- Select OK
- Select the defaults for the account and select OK to close dialog