Thursday, August 11, 2016

ASP.NET: Login failed for user 'DOMAIN\MACHINENAME$'

Symptom: 












Root cause: web application is using the account which doesn't have access to connect to SQL server

Solution:

  1. add "NT AUTHORITY\NETWORK SERVICE" as SQL Server login, allow it to access the database (in the "User Mapping", assign the db_owner role for the corresponding databases)
  2. in IIS, create a custom application pool which is using "NetworkService" as Identity (make sure to use Integrated pipeline). then change the web application to use this pool

No comments: