IIS 7.5 One Application Pool works, a second one doesn’t work

.net-4.0application-poolsiis-7.5

I have a website (Alpha) running successfully on an IIS 7.5 webserver running on Windows Server 2008 R2.

I basically want to clone Alpha and have a second website Beta, the same as Alpha, but will have somewhat different code. I've created the second website and also created a second Application pool. As far as I can tell, the two application pools are configured the same: auto start, v4.0, Integrated, Identity: ApplicationPoolIdentity.

The second website (Beta) doesn't work if I connect it to its own Application Pool, but works fine if I connect it to Alpha's Application Pool. As far as I can remember, I did not do anything special to Alpha's Application Pool. As far as I can tell, the advanced settings are the same for both.

The failure Beta has when connected to its own Application Pool is is getting an unhandled exception: Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'

Any ideas on how to compare the two Application Pools, or to debug the overall system would be appreciated.

I tried deleting Beta's Application Pool and re-creating it.

Best Answer

You are connecting to a SQL-Server with integrated Security right? It seems the second pool identity does not have access to your SQL-Server/database.

Using ApplicationPoolIdentity, your app is connecting to SQL-Server as something like:

IIS AppPool\AppPoolName

make sure that both Application pool identities have access to your server and the database in question.

I could create a Windows group to put the various Application pool identities in and then give that Windows group access to your database.

Also check this question, which seems to address a similar problem and suggest a reboot of the server.