Dev GuideAPI Reference
Dev GuideAPI ReferenceDev CommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

Add app settings and connection strings

Describes how you can manage custom app settings and connection strings of your DXP project.

Use these steps to access the App Settings feature:

  1. Log in to the PaaS portal with your credentials.
  2. Select the project you want to manage.
  3. Click on the App Settings tab on the project page.

Follow these steps to add or update an app setting or connection string:

  1. Click Add Secret to add a setting, or click the Edit icon next to the existing setting. If you must delete a setting, click the Delete icon.
  2. Provide the following information:
    • Name – Enter a unique name for the setting. Secret names must be between 1 and 127 characters long, can only contain alphanumeric characters, underscore, and colon characters.
    • Environment – Choose the environment for the setting. You can select from Integration, Preproduction, Production, or ADE.
    • Value – Enter the value for the setting or connection string.
  3. Click Save to store the new or updated setting.

The next deployment activates the added or updated setting to the selected environment. The setting is also available in the deployment slot during deployment. To activate settings without a full code deployment, see Apply settings without a code deployment.

Secret values can be accessed from web app code using IConfiguration, the same way as other application settings.

public class MyPageController: PageController<MyPageData> {
  private readonly IConfiguration _config;

  public MyPageController(IConfiguration config) {
    _config = config;
  }

  public IActionResult Index(MyPageData currentContent) {
    // Get data from configured App Settings
    var secret = _config.Get<string>("MySecretKey", "Fallback value");

    //...
  }
}

You should test your changes in the Integration and Preproduction environments before deploying to Production to identify and resolve any potential issues before they impact your site.

Apply settings without a code deployment

By default, the next code deployment activates added or updated settings in the selected environment. To apply changes immediately without a full code deployment, use Apply Settings. You can do this to update existing settings or to add new settings.

  1. Go to the App Settings tab.
  2. Select Apply Settings.
  3. Select the target environment.
  4. Confirm that you want to apply the settings.

Optimizely reads the settings from Key Vault and pushes them to the web app. The web app restarts automatically to load the new values, causing a few minutes of downtime, so apply settings during a low-traffic period. Applying settings also removes any secrets marked for removal in that environment.

You cannot apply settings if a deployment to the same environment is already in progress. While the operation runs, the following restrictions apply:

  • Code deployments to the environment are blocked.
  • You cannot start another apply settings operation for the same environment.

The portal displays the operation status and a link to the apply settings job.

📘

Note

If you have previously added a specific setting through support and then add one with the same name through PaaS portal, the next deployment overwrites the setting with the new value.



Did this page help you?