Production and Staging environments
Sitefinity Cloud provides customers with Continuous Delivery (CD) setup consisting of two isolated environments - Production and Staging. This way code changes are first deployed to the Staging environment, where stakeholders verify the project and new functionality is working as expected and will not affect the production website. Once verified, the new functionality can be promoted to the Production environment. Promoting code to Production is made possible while maintaining the public website availability.
In the Production environment, content editors are able to author content in an efficient and secure fashion, utilizing the Sitefinity content editing capabilities and content approval workflow. Website visitors can access the public content via the website public URL. The Production environment scales automatically to ensure optimal performance and high availability.
Deploying new functionality to Production is done via preconfigured deployment pipelines available in the Management Portal.
The following diagram visualizes the production environment workflow:
This environment is used by website stakeholders from the customer and partner teams, including business users and technical team like development and QAs. The environment is separated from Production and is designated for user acceptance testing (UAT). Unlike Production, which scales automatically, Staging consists of a static number of instances.
Deploying new functionality to Staging and then to Production is done via preconfigured deployment pipelines available in the Sitefinity Cloud Management Portal.
Use different website configurations for different environments
Your Sitefinity Cloud website is configured in a Continuous Delivery (CD) pipeline setup. This way, code changes get deployed to Staging, and then to Production. In such setup, the code base does not change, however your website configurations might need to vary to reflect different environment settings, like connection strings, SMTP settings, and so on. Sitefinity Cloud enables you to leverage Continuous Delivery pipelines environment variables to easily define and manage the transformations for each environment. For more information see the Manage configurations in a CD pipeline article from the Sitefinity CMS documentation.
In case different configurations should be applied on the different environments, there are two options to do that, depending on the value type of the configuration itself.
Sensitive information needs to be transformed
In this case, Sitefinity Cloud enables you to leverage Continuous Delivery pipelines environment variables to easily define and manage the transformations for each environment. Desired values should be entered as key-value pair in the variable group designated for the specific environment:
Variable values can be marked as secret:
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. As a prerequisite, you should add these configurations in your web.config:
<!-- Notification Settings -->
<add key="sf-env:notificationsConfig/profiles/Default:username" value="" />
<add key="sf-env:notificationsConfig/profiles/Default:password" value="" /></appSettings>
Non-sensitive information needs to be transformed
In Visual Studio, Staging and Production configurations should be added through the Configuration manager for the solution.
After that you add config transform to the web.config:
Set the build action to Content to both Staging and Production transforms, in order to be included in the deployment package.
<!-- My custom configurations -->
<add key="sf-env:myCustomConfig:testMode" value="true" />
<!-- My custom configurations -->
<add xdt:Locator="Match(key)" xdt:Transform="SetAttributes" key="sf-env:myCustomConfig:testMode" value="false"/>
During deployment Staging and Production transforms will be applied to the web.config.
For more information, see https://docs.microsoft.com/en-us/aspnet/web-forms/overview/deployment/visual-studio-web-deployment/web-config-transformations