title: How to encrypt an Azure Devops Release Pipeline web config
body: <p>I currently have a release pipeline that uses a self hosted agent.  The agent does a web transformation on the config file and copies the files to an on-prem server.  The last step that I need to complete is to encrypt the connection strings in the web config file.</p>
  
  <p>I have tried using a powershell script to encrypt, like I would do directly on the server:</p>
  
  <p>C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis -pe "connectionStrings" -app "/{app}" -site "{site}"</p>
  
  <p>But get the following error:
  The configuration for virtual path '/{app}' and site '{site}' cannot be opened.</p>
  
  <p>Has anyone else run into this issue or found a different way of encrypting the connection strings in the release pipeline?</p>