---
title: "Manage environment variables in the Deploy app"
slug: "manage-environment-variables-in-the-deploy-app"
abstract: "Describes how to create, edit, and delete environment variables in the Deploy app."
---

# 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](https://doc.sitecore.com/sai/en/developers/sitecoreai/deploying-sitecoreai/deploy-app/manage-an-environment.html#UUID-e4b70229-154c-fd24-03f8-3098e09d2eec_section-idm1733329911802898 "Create a build and deploy it to an environment") 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](https://doc.sitecore.com/api/markdown-image/sai/en/developers/sitecoreai/images/environment-variables-deploy-app.png)

## 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](https://doc.sitecore.com/sai/en/developers/sitecoreai/deploying-sitecoreai/the-sitecoreai-build-configuration.html#UUID-62230c7d-0e8e-6a81-3434-3b12f25a5808_section-idm4568099360318433299161991908 "Configuration options for rendering hosts").
   >
   > This applies only to the Sitecore-managed Editing host used for authoring and WYSIWYG editing. Environment variables are <b>not</b> injected into externally hosted rendering hosts.
   >
   > For example, in the following `xmcloud.build.json` file code snippet, `nextjsstarter` is a rendering host name.
   >
   > {
   > "renderingHosts": {
   > "nextjsstarter": { // Rendering host name
   > "path": "./headapps/nextjs-starter",
   > ...

   > [!note]
   > **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** :mdiDotsHorizontal:(../../../../images/actions-menu-horizontal-icon.png) > **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** :mdiDotsHorizontal:(../../../../images/actions-menu-horizontal-icon.png) > **Delete variable**.
6. In the **Delete variable** dialog, click **Delete**.
