0
votes

I am new to IIS and MS SQL Server (coming from a Apache MySQL Environment) so hopefully I will include enough details for you guys to help me!

I am converting my web app from using hard coded database credentials (currently SA :/ ) in the Connection String in web.config.

I removed the username and password and put in "Integrated Security=SSPI". The website is configured with a dedicated app pool and that app pool Identity is set to the domain account I want it to use. When I attempt to use the web app I get an error. When I look into the SQL Server logs I see "Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. Reason: Could not find a login matching the name provided.

Any ideas on what I am doing wrong?

1
I'm not an IIS expert myself, however it's clear that your website/web app is trying to connect anonymously to SQL Server via NT AUTHORITY\ANONYMOUS LOGON. You could add that login to SQL Server, but it's probably a very bad idea. I'd go back to SQL authentication in your web.config. Just don't use sa (or any other login with sysadmin permissions). - Dave Mason
@user3858056, you are wise to avoid using the sa account for routine data access. Also, Windows authentication is more secure and should be used whenever possible. - Dan Guzman

1 Answers

0
votes

Add (or modify) the element below to the system.web section of your web.config.

<identity impersonate="true" />

See http://msdn.microsoft.com/en-us/library/vstudio/134ec8tc(v=vs.100).aspx