'Use jenkins agent to set database credentials in web.config during build

Looking for some advice.

Setup:

  • Jenkins build agent
  • c# .NET 4.5 project
  • Oracle database connection string stored in web.config

I'm trying to achieve the following:

  1. Store the database username/password as an encrypted key/value pair on Jenkins.
  2. Retrieve and pass the username and password to MSBuild which can update web.config with the credentials passed in via the command line.

It's step 2 that I'm having difficulty with and wondered if anyone could help with how to do it?

Thanks!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source