Search code examples
asp.netiisweb-configrefresh

What are the Steps to follow to update web.config in an IIS webserver


I am new to web development. We are having a legacy intranet web application using ASP.NET web forms.

We have encrypted web.config using ASPNET_REGIIS tool for the connection strings, based on security feedback. I am able to test it locally using IISExpress.

What are the steps to follow to update the old web.config with new web.config, in an environment.

We need to update web.config in multiple environments(DEV,TEST, UAT) before refreshing in production.

We will be announcing downtime for the same. Please list down the steps like resetting IIS etc.


Solution

  • I had to do below steps:

    1. First and Foremost: Took a backup of existing web.config, so that, if something goes wrong, I can fallback to original web.config
    2. As web.config encryption is machine specific, I encrypted the web.config using ASPNET_REGIIS tool, as mentioned in the codeproject Link
    3. Web.config changes are automatically picked by IIS. I did not have to restart IIS or recycle APPPool. The site was working fine with the new web.config changes, I made.