deploying web app with env specific appsetting
Using the new version of the Azure App Service Deploy task makes it easy to implement this approach as long as you define the values of the settings that you want to replace in each environment
Refer Managing Configuration and App Settings for Multiple Environments in Your CD Pipeline
To replace application settings, add variables to the release task and send the json file for variable substitution into the task.
If you want to change app settings and connection strings value before deploying to each web app ,you can do this either by applying a Web.config transformation or by substituting variables in your Web.config file.
Based on the stage name supplied, the Azure App Service Deploy action allows users to edit configuration settings in configuration files (*.config files) inside web packages and XML parameters files (parameters.xml).
File transforms and variable substitution are also supported by the separate File Transform task for use in Azure Pipelines.
In "Deploy Azure App Service" release task you can see a File Transforms and Variable Substitution section.There you need to supply the path to the json file you want to swap variable values.
![enter image description here]()
- Click on the options button on the release environment. You will see an option to configure variables in the pop out menu.
![enter image description here]()
Add the json property you want to modify as a variable.
Put in your connection string or App Settings value. Azure Devops will then swap out these values for you when deploying.
Configuration substitution is specified in the File Transform and Variable Substitution Options section of the settings for the tasks.
Please refer File transforms and variable substitution reference for more information