Manage the configurations

Your Sitefinity Cloud website is configured in a Continuous Delivery (CD) pipeline setup. This way, code changes are deployed to non-Production environments like Staging first, 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.

To utilize app settings transformations, Sitefinity Cloud uses the approach of configuring the app settings in the Azure App Service, which override the ones in the web.config and appsettings.json

Settings transformation

To create custom app settings for different environments, perform the following:

  1. Login to Sitefinity Cloud Management Portal.
  2. Navigate to Pipelines » Library.
  3. Open Custom <Environment name> AppSettings variable group.
  4. For each setting, fill out the following:
    • Key - the path to the configuration property (sf-env:pathToConfigurationProperty)
      For more information about finding out the path to the property, see Manage configurations in Continuous delivery pipeline.
    • Value - the required configuration setting value
      In case you want to use Key Vault secrets for the value, enter the name of the secret using this pattern: $(<NameofSecretinKeyVault>)
      Secrets can also be used for parts of the value and you can use multiple secrets in one value:
      DefaultEndpointsProtocol=https;AccountName=$(MediaLibraryStorageName);AccountKey=
      $(MediaLibraryStorageKey)

      For information about using Key Vault secrets, see Azure Key Vault.

NOTE: If you want your app settings to apply for all environments, add the settings in Custom Release AppSettings variable group.

Connection strings transformations

To create different connection strings for different environments, perform the following:

  1. Login to Sitefinity Cloud Management Portal.
  2. Navigate to Pipelines » Library.
  3. Open Custom <Environment name> AppSettings variable group.
  4. For each string, fill out its Key and Value.
    In case you want to use Key Vault secrets for the value, enter the name of the secret using this pattern: $(<NameofSecretinKeyVault>)
    Secrets can also be used for parts of the value and you can use multiple secrets in one value:
    data source=tcp:$(ServerName).database.windows.net,1433;User ID=$(ServerUserName);
    Password=$(ServerPassword);initial catalog=$(DatabaseName);Persist Security Info=False;
    MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection
    Timeout=30;Backend=SqlAzure;SF_ignoreDowngradeExceptions=true;

    For information about using Key Vault secrets, see Azure Key Vault.

NOTE: If you want your connection strings to apply for all environments, add the settings in Custom Release ConnectionStrings variable group.

Settings transformation for .NET Core Renderer

To utilize app settings transformations, the .NET Core Renderer application uses the approach of configuring the app settings in the Azure App Service, which override the ones in the appsettings.json.

To create custom app settings for different environments, perform the following:

  1. Login to Sitefinity Cloud Management Portal.
  2. Navigate to Pipelines » Library.
  3. Open Custom DotNetCoreRenderer <Environment name> AppSettings variable group.
  4. For each setting, fill out the following:
    • Key - the required configuration setting key
    • Value - the required configuration setting value

NOTE: Because the .NET Core Renderer Application is deployed on Linux Web Apps, any nested JSON key structure in the app setting name, such as ApplicationInsights:InstrumentationKey needs to be configured in App Service as ApplicationInsights__InstrumentationKey for the key name. The convention is that each : (colon) must be replaced with __ (double underscore).

NOTE: If you want your app settings to apply for all environments, add the settings in Custom Release DotNetCoreRenderer AppSettings variable group.

Was this article helpful?