locked
how to encrypt a web.config file when using a Web Deployment Project RRS feed

  • Question

  • User-1614457691 posted

    All --

    Please help.

    I need to know the standard practice on how to encrypt a web.config file when using a Web Deployment Project (WDP).

    For example...

    ...does one encrypt the web.config file, build with the WDP, package the site as into "setup.exe" or similar, move the package to a deployment target, and deploy?

    ...or...

    ...does one build with the WDP, package the site as into "setup.exe" or similar, move the package to a deployment target, run the "setup.exe", then encrypt the "web.config" file?

    ...or...

    ...something else, such as BuildEvents or a custom MsBuild task or what?

    We usually try to encrypt all encryptable parts of our "web.config" files here-- so, as we move to a WDP-based approach, we need to know the norm, etc.

    What do you think?

    Please advise.

    Thank you.

    -- Mark Kamoski

    Thursday, May 13, 2010 3:50 PM

Answers

All replies

  • User1694884538 posted

    You can encrypt some parts of your web.config (eg. Connection String). Please refer to the link below;

    http://msdn.microsoft.com/en-us/library/dtkwfdky.aspx 

    Thursday, May 13, 2010 4:46 PM
  • User-1614457691 posted

    You can encrypt some parts of your web.config (eg. Connection String). Please refer to the link below;

    Rai --

    I appreciate your excellent reply.

    Yes, I do know that one can encrypt a "web.config" file manually, as shown at the link above.

    However, what about doing it automatically or in an manner that is integrated into a Web Deployment Project (WDP)?

    Furthermore, what about the consideration that if one is using a WDP as a packaging mechanism, to collect the files for deployment to Staging or Production on another machine, then the question becomes even more complicated-- can one encyrpt on one machine and then deploy onto another?

    Do you know how that can be done in terms of an actual implemenation, etc?

    Please advise.

    Thank you.

    -- Mark Kamoski


    Friday, May 14, 2010 10:25 AM
  • User1694884538 posted

    Hi! I did a little research and found this topic @ StackOverflow

    http://stackoverflow.com/questions/950978/automatically-encrypt-sections-of-web-config-after-deploy-publish

    Hope it helps. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, May 14, 2010 4:49 PM