I usually run ASP.NET app pool as a separate account (not NT AUTHORITY\NETWORK SERVICE
) and use Windows authentication to access the SQL Server. This method has the advantage of not storing the password in config files.
Steps:
- Create a user account to run your ASP.NET application on.
- Create an application pool in IIS and run it on the created account.
- Assign NTFS permissions that your application needs to the account.
- Grant permission to login on SQL Server.
- Assign the appropriate database roles to the created login.
This will work for many apps. For more complex security environments, you might need more sophisticated strategies.