Web.config file is transformed locally with different environments like(DEV, QA, Prod). How these environment specific config files will be used while release the application on different environment like(DEV, QA, Prod) on VSTS.
Both the Azure and IIS deployment tasks now support file transforms and variable substitution.
The File Transformation will look for and apply a *.<environment>.config
transform file where <environment>
matches the Azure Pipeline environment for which the task is executing.
Variable Substitution will apply the value of any pipeline variables to the corresponding connectionStrings or appSettings entries where the name matches the variable name.
There is XDT Transform extension that can apply transform for config file, so the easy way is that you can include/add the related configure files in release artifact, then configure transform per to release environments.
Another way is that you can replace the value in configure file through Replace Tokens or Tokenization task.
On the other hand, if you are deploying the app through Azure App Service Deploy task, there is File Transforms & Variable Substitution Options that can do transform.
Yesterday I published a blog on how to do this in VSTS: https://www.4dotnet.nl/kennis/blog-deploying-your-asp-net-web-app-and-database-to-azure-using-vsts
In other scenario's, I've successfully used the XDT Transformation Tool: https://ctt.codeplex.com/
© 2022 - 2024 — McMap. All rights reserved.