Manage the configurations
Your Sitefinity Cloud website is configured in a Continuous Delivery (CD) pipeline setup. This way, code changes are deployed to Staging and then to Production. In such setup, the code base does not change, but your website configurations may need to vary to reflect different environment settings, such as connection strings and SMTP settings.
web.config transformations, Sitefinity Cloud uses the same approach as described in procedure Manage configurations in Continuous delivery.
When you need to apply different configurations for the different environments, there are two options to do so, depending on the value type of the configuration itself.
Transform sensitive information
When you need to transform configurations that store sensitive information, you can use environment variables. You enter the desired values as key-value pairs in the variable group, designated for the specific environment:
You edit the environmental variables in the Variable groups:
To add a variable, perform the following:
- Click the desired variable group.
- In the Variables section, click Add.
- Fill out the Name and the Value.
Use the same approach as described in procedure Manage configurations in Continuous delivery.
- You can make a variable value secret by clicking the padlock icon.
- Open the
web.config and add the variables in the
Use the following example:
During deployment pipeline searches the
web.config for the input key and replaces its value with the value from the pipeline variable for the specific environment.
Transform non-sensitive information
- Open your project in Visual Studio.
- In the Configuration manager, add the Staging and Production configurations:
- Open the context menu of the
web.config file and click Add Config Transform.
- Add the
- To include the transformations in the deployment package, set their build action to Content.
EXAMPLE: Following is an example of the production transformation of a
RESULT: During deployment Staging and Production transforms will be applied to the web.config.