Skip to main content

Environment variables

Abstract

Describes environment variables in XM Cloud.

In the XM Cloud Deploy App, you can manage settings that change by XM Cloud environment by creating environment variables in the XM Cloud Deploy App.

Environment variables are key-value pairs created outside your XM Cloud environment source code so that each value can change depending on the environment. When you create an environment variable, it is available for reference in your XM Cloud environment source code.

Environment variables simplify configuration changes because you do not have to modify source code.

For example, in your XM Cloud production environment, you can create environment variables with production API URLs and authentication keys to connect to your production product catalog in OrderCloud. While in your XM Cloud staging environment, you can change the values of the environment variables to connect to your staging product catalog instead.

You can also use the Sitecore Command Line Interface (CLI) with the XM Cloud plugins to create, update , and delete environment variables.

XM Cloud environments come with the following predefined environment variables:

The SITECORE_SPE_ELEVATION environment variable specifies how the system responds to your attempts at using the SPE module for activities such as running Powershell scripts inside your XM Cloud instance.

For security purposes, the default value of the session elevation action value for SPE is Blocked. Therefore, the following applications and activities are blocked:

By changing the value of the SITECORE_SPE_ELEVATION environment variable, you override the default blocking behavior when you want to elevate the permissions to complete an otherwise blocked task.

The available values are:

Value

Description

Block

Default value. Always blocks the session from running elevated without prompting the user for permission.

Confirm

Prompts the user for a confirmation before running the session elevated.

Allow

Always allow the session to run without prompting the user for permission.

Danger

Only set the SITECORE_SPE_ELEVATION value to Allow for a local environment.

Note

The values are case-sensitive.

When using the Sitecore Authoring and Management GraphQL API, you can expose the GraphQL playground with the help of the Sitecore_GraphQL_ExposePlayground environment variable. The GraphQL playground is disabled by default. You must enable and authorize the Authoring and Management API GraphQL playground before you can use it.