This topic is meant to serve as a quick guide for developers and not as a comprehensive security guide.
Here’s a quick way of getting your ASP.NET application to talk to your SQL Server database once you’ve made the move to use IIS instead of IISExpress. So far the steps below only demonstrate how to get IIS and SQL talking on the same machine. If they are on different machines, you may have to use the NETWORKSERVICE account or a specific domain account (please, correct me if I’m wrong!). See these MSDN articles:
If you are trying to configure SQL server and IIS on the same development box, keep on reading.
Names have been blanked out to protect the innocent.1. If you have created a specific Application Pool for your ASP.NET application, then skip to step 4. Otherwise, it’s time to do so.
2. Configure the application pool – select the version of the .Net framework you desire.
3. Edit your IIS Application to use this application pool
4. In SQL Server Enterprise Manager, create a new Login
5. Enter the details for the login manually (do not use search) as IIS APPPOOL\MyApplicationPool
6. In the user mapping, configure this login to have access to your database
7. When you press OK, you should now have a login under both the general Security/Logins folder and within the mydatabase->Users folder as below.
Job done… hopefully.
As I said, this is intended as a quick guide rather than a comprehensive security-based tutorial. If I find articles that improve this post, I’ll add them later.
This post is a reblog of the content I discovered here http://stackoverflow.com/questions/1933134/add-iis-7-apppool-identities-as-sql-server-logons