How to transform Web.Config file 'Properly' with VSTS!Aug 26, 2017 | Tarun Arora DevOps BuildPipeline
Web development and the frameworks that go with it have evolved over the years, but when it comes to transforming config file people still use the old ways! If you are still using one of these approaches, you need to change…
- One configuration file per environment
- Tokenization of configuration files using parameters.xml and then using a tokenizer to replace values during deployment
VSTS now natively supports config transforms!
Visual Studio Team Services offers the
Azure App Service Deploy task, version 3 of this task now natively supports config transformation. Let’s see this in action…
Scroll down to the File Transforms & Variables Substitution Options section and check the option
XML variable substitution
Navigate to the variables section in the release definition and create a key to replace the connection string with a value for a specific environment.
You have the option to encryt the value and also specify the scope of the variable to an environment or the entire definition.
Now fire the release and let this task execute, look at the logs, you’ll see the transformation has been completed for you…
Let’s look at the value in the config file…
No more going back to the old ways of transforming webconfig files… VSTS has you covered. #DevOpsOn