I've got a new server build running Windows Server 2012 R2, IIS 8.5 (inc. ClassicASP feature) and SQL Server 2014 Express. I want to use Application Pool Identity to connect to the database. The database is set to "Windows Authentication Mode".
My Application Pool Identity is called activbase.net
. I've set up a Security Login in SQL Server called IIS AppPool\activbase.net
and user mapped it my database with db_datareader
and db_datawriter
access.
However when I try to access the database from the website, I get:
Cannot open database "ActivbaseLive" requested by the login. The login failed.
I thought this was enough to get the connection working. The Application Log (Event Viewer) shows:
Login failed for user 'NT AUTHORITY\IUSR'. Reason: Failed to open the explicitly specified database 'ActivbaseLive'. [CLIENT: ]
So I have added NT AUTHORITY\IUSR
likewise to the SQL Server>Security>Logins and Databases>[ActivbaseLive]>Security>Users and this fixes the problem.
My questions are as follows:
- Should I be needing to add
NT AUTHORITY\IUSR
login/user in addition toIIS AppPool\activbase.net
login/user to my SQL Server Instance and database? - Is there a security issue with doing this? (NOTE: this will be a production environment)
Thanks, Chris