HomeDev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunitySubmit a ticketLog In
GitHubNuGetDev CommunitySubmit a ticket

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, double 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.

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.

📘

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.