Manage environment variables in the Deploy app

You can manage settings that change by environment by declaring environment variables.

Important

Modifying environment variables requires a rebuild/redeploy of your environment for the changes to take effect.

Environment variables created in the Deploy app are applied only to the Content Management (authoring) environment and the Editing host. They are not propagated to externally hosted rendering hosts (for example, Vercel, Netlify, or Azure App Services).

Variables tab

Create an environment variable

Note

If you've enabled the beta feature that lets you separately deploy your authoring environments and editing hosts, you can also create environment variables when you create a project, add an authoring environment, or add an editing host.

To create an environment variable:

  1. On the navigation pane of the Deploy app, click Projects.

  2. On the Projects page, click the project that contains the environment where you want to create an environment variable.

  3. On the project page, click the environment where you want to create a variable.

  4. On the environment page, click Variables, then click Create variable.

  5. In the Create variable dialog, in the Name field, enter a name for your environment variable.

  6. In the Value field, enter a value for your variable.

  7. If you want to encrypt your variable and hide its value, turn on the Secret toggle.

  8. In the Target field, choose the target for your environment variable.

    Note

    If the target is an editing host, the rendering host name must match one of the editing/rendering hosts defined in the the xmcloud.build.json file.

    This applies only to the Sitecore-managed editing host used for authoring and WYSIWYG editing. Environment variables are not injected into externally hosted rendering hosts.

    For example, in the following xmcloud.build.json file code snippet, nextjsstarter is a rendering host name.

    RequestResponse
    {
        "renderingHosts": {
          "nextjsstarter": { // Rendering host name
            "path": "./headapps/nextjs-starter",
            ...
    XM Cloud is now SitecoreAI

    Some code examples, images, and UI labels may still use XM Cloud while engineering assets are being updated.

  9. Click Save.

Edit an environment variable

To edit an environment variable:

  1. On the navigation pane of the Deploy app, click Projects.

  2. On the Projects page, click the project that contains the environment where you want to edit an environment variable.

  3. On the project page, click the environment where you want to edit a variable.

  4. On the environment page, click Variables.

  5. On the Variables tab, locate the variable you want to edit, then click Actions > Edit variable.

  6. In the Edit variable dialog, edit your variable, then click Save.

Delete an environment variable

To delete an environment variable:

  1. On the navigation pane of the Deploy app, click Projects.

  2. On the Projects page, click the project that contains the environment where you want to delete an environment variable.

  3. On the project page, click the environment where you want to delete a variable.

  4. On the environment page, click Variables.

  5. On the Variables tab, locate the variable you want to delete, then click Actions > Delete variable.

  6. In the Delete variable dialog, click Delete.

Do you have some feedback for us?

If you have suggestions for improving this article,