How to encrypt web.config connection strings during deployment from the command line by specifying an encryption provider?

I know that I can do this to encrypt the connection strings on an already deployed website:

aspnet_regiis -pe connectionStrings

I can also encrypt the connection strings on the website before deploying it by doing the following:

aspnet_regiis -pef connectionStrings .\WebApplication1

I also know how to make my own RSA key, install it on several computers and configure the encryption provider for this key, so I can encrypt it on one computer and publish it on another:

aspnet_regiis -pef connectionStrings .\WebApplication1 -prov MyProvider

I can even tell MSBuild to encrypt the connection strings for me during deployment by adding the string to the .pubxml file ( https://msdn.microsoft.com/en-us/library/ee942158%28v=vs.110%29.aspx# encrypt_webconfig ).

:

  • - ;
  • -, web.config web.debug.config web.release.config;
  • web.config ;

. . , -, web.config. -, , , - . , . ? . msbuild, msdeploy .pubxml .

, - - msbuild.exe/msdeploy.exe/*.pubxml ANYWHERE. ( .)

+4

Source: https://habr.com/ru/post/1607284/


All Articles