Let’s say you have a web application that needs to connect to a SQL server using integrated auth. You could set the app pool of your IIS application to run as a specific account – but that could easily lead to trouble, if it’s not appropriate for other apps in the app pool to run as that account. Can’t I just get my application to run as a different account? Sure!
The developer puts something like below in their web.config:
Then, you can use the downloaded tool called aspnet_setreg.exe to encrypt the password and store it in the registry key above. Voila!