> ## Documentation Index
> Fetch the complete documentation index at: https://astronomer.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Rotate credentials in Astro

> Update credential values stored as environment variables, connections, or Airflow variables at the Workspace or Deployment level.

To rotate a credential in Astro, first identify whether it's stored at the Workspace level or the Deployment level. At either level, it can be an environment variable, a connection, or an Airflow variable. For background on how Astro stores these values, see [Secrets management](https://astronomer.io/docs/astro/secrets-management).

## Workspace-level credentials

In the Astro UI, go to **Environment** and select **Environment Variables**, **Connections**, or **Airflow Variables**.

When you update a Workspace-level value, the change applies to all linked Deployments and finishes updating within a few minutes.

> [!NOTE]
>
> If a linked Deployment has a value override, it keeps its override value. To rotate the credential for those Deployments, update the link as well. See the last step of each procedure below.

### Environment variables

**1. Edit the environment variable**

Open the **More actions** menu (⋯) next to the environment variable, then click **Edit Environment Variable**.

![The More actions menu for an environment variable with the Edit Environment Variable option highlighted](https://mintcdn.com/astronomer/-MhnTcheTwFOZZX2/images/docs/rotate-credentials-ws-env-var-menu.png?fit=max\&auto=format\&n=-MhnTcheTwFOZZX2\&q=85\&s=734525017abfb4fbac82c80cd2fa6d4f)

**2. Enter the new value**

In the **Environment Variable Value** field, enter the newly generated value for your credential, then click **Update Environment Variable**.

![The Edit Environment Variable dialog showing the Environment Variable Value field](https://mintcdn.com/astronomer/-MhnTcheTwFOZZX2/images/docs/rotate-credentials-ws-env-var-edit.png?fit=max\&auto=format\&n=-MhnTcheTwFOZZX2\&q=85\&s=44650e291483d1cdd22b10e0ac02082d)

**3. Update linked Deployments with overrides**

Click the environment variable to see all linked Deployments.

![The environment variable details page with the Linked Deployments tab selected](https://mintcdn.com/astronomer/-MhnTcheTwFOZZX2/images/docs/rotate-credentials-ws-env-var-linked.png?fit=max\&auto=format\&n=-MhnTcheTwFOZZX2\&q=85\&s=94da65d135b78e8c9256e9944777d5f3)

For each Deployment that has an override, open the **More actions** menu (⋯), then click **Edit Link**.

![The More actions menu for a linked Deployment with the Edit Link option highlighted](https://mintcdn.com/astronomer/-MhnTcheTwFOZZX2/images/docs/rotate-credentials-ws-env-var-link-menu.png?fit=max\&auto=format\&n=-MhnTcheTwFOZZX2\&q=85\&s=cc533c9058f797bd5289aebea6bb22c8)

Enter the new value in the **Value** field, then click **Update Environment Variable Link**.

![The Edit Environment Variable link to Deployment dialog showing the override Value field](https://mintcdn.com/astronomer/-MhnTcheTwFOZZX2/images/docs/rotate-credentials-ws-env-var-link-edit.png?fit=max\&auto=format\&n=-MhnTcheTwFOZZX2\&q=85\&s=c72016f1c7aee0d0fb9297fd61441a37)

### Connections

**1. Edit the connection**

Open the **More actions** menu (⋯) next to the connection, then click **Edit Connection**.

![The More actions menu for a connection with the Edit Connection option highlighted](https://mintcdn.com/astronomer/-MhnTcheTwFOZZX2/images/docs/rotate-credentials-ws-connection-menu.png?fit=max\&auto=format\&n=-MhnTcheTwFOZZX2\&q=85\&s=42f683f4b58a6fafaf542e5c784e30a7)

**2. Enter the new values**

Enter the newly generated values for your credential in their respective fields, then click **Update Connection**.

![The Edit Generic Connection dialog showing the connection fields](https://mintcdn.com/astronomer/QbQhGRA27C2PmKkr/images/docs/rotate-credentials-connection-edit.png?fit=max\&auto=format\&n=QbQhGRA27C2PmKkr\&q=85\&s=01e97e6b350198024927eb19fb777257)

> [!NOTE]
>
> The fields in this dialog differ depending on the connection type.

**3. Update linked Deployments with overrides**

Click the connection to see all linked Deployments.

![The connection details page with the Linked Deployments tab selected](https://mintcdn.com/astronomer/-MhnTcheTwFOZZX2/images/docs/rotate-credentials-ws-connection-linked.png?fit=max\&auto=format\&n=-MhnTcheTwFOZZX2\&q=85\&s=8d41d77d5eed0fb76f73a1f62c643a1b)

For each Deployment that has an override, open the **More actions** menu (⋯), then click **Edit Link**. Enter the new values in their respective fields, then click **Update Connection Link**.

![The Edit Connection link to Deployment dialog showing the override fields](https://mintcdn.com/astronomer/-MhnTcheTwFOZZX2/images/docs/rotate-credentials-ws-connection-link-edit.png?fit=max\&auto=format\&n=-MhnTcheTwFOZZX2\&q=85\&s=f49236128b7cf6a7ca866dcdaf0ef90f)

### Airflow variables

**1. Edit the Airflow variable**

Open the **More actions** menu (⋯) next to the Airflow variable, then click **Edit Airflow Variable**.

![The More actions menu for an Airflow variable with the Edit Airflow Variable option highlighted](https://mintcdn.com/astronomer/-MhnTcheTwFOZZX2/images/docs/rotate-credentials-ws-airflow-var-menu.png?fit=max\&auto=format\&n=-MhnTcheTwFOZZX2\&q=85\&s=c934bb8841bb2d1d786afa47be6ae7e3)

**2. Enter the new value**

In the **Airflow Variable Value** field, enter the newly generated value for your credential, then click **Update Airflow Variable**.

![The Edit Airflow Variable dialog showing the Airflow Variable Value field](https://mintcdn.com/astronomer/-MhnTcheTwFOZZX2/images/docs/rotate-credentials-ws-airflow-var-edit.png?fit=max\&auto=format\&n=-MhnTcheTwFOZZX2\&q=85\&s=adde2ea65076fa777ac2c4cfb528e8f4)

**3. Update linked Deployments with overrides**

Click the Airflow variable to see all linked Deployments.

![The Airflow variable details page with the Linked Deployments tab selected](https://mintcdn.com/astronomer/-MhnTcheTwFOZZX2/images/docs/rotate-credentials-ws-airflow-var-linked.png?fit=max\&auto=format\&n=-MhnTcheTwFOZZX2\&q=85\&s=b37ed25d2adad3cf6ac2b4598bec0c53)

For each Deployment that has an override, open the **More actions** menu (⋯), then click **Edit Link**. Enter the new value in the **Value** field, then click **Update Airflow Variable Link**.

![The Edit Airflow Variable link to Deployment dialog showing the override Value field](https://mintcdn.com/astronomer/-MhnTcheTwFOZZX2/images/docs/rotate-credentials-ws-airflow-var-link-edit.png?fit=max\&auto=format\&n=-MhnTcheTwFOZZX2\&q=85\&s=a92066ab658037774dfac82f501cf845)

## Deployment-level credentials

In the Astro UI, click **Deployments**, select a Deployment, then click the **Environment** tab.

![The Environment tab of a Deployment, with sub-tabs for Environment Variables, Connections, and Airflow Variables](https://mintcdn.com/astronomer/QbQhGRA27C2PmKkr/images/docs/rotate-credentials-deployment-env-tab.png?fit=max\&auto=format\&n=QbQhGRA27C2PmKkr\&q=85\&s=b74bef2bad70c21f67675e8d8676dc43)

When you update a Deployment-level value, the change is deployed to that Deployment and finishes updating within a few minutes.

### Environment variables

**1. Edit the environment variables**

Click **Edit Deployment Variables**.

![The Environment Variables sub-tab of a Deployment with the Edit Deployment Variables button](https://mintcdn.com/astronomer/QbQhGRA27C2PmKkr/images/docs/rotate-credentials-deployment-env-var-list.png?fit=max\&auto=format\&n=QbQhGRA27C2PmKkr\&q=85\&s=03a8d7a319fec01c5a53cd11cdb19995)

**2. Enter the new value**

In the dialog, enter the newly generated value for your credential next to its key, then click **Update Environment Variables**.

![The Edit Environment Variables dialog listing each key, value, and source](https://mintcdn.com/astronomer/QbQhGRA27C2PmKkr/images/docs/rotate-credentials-deployment-env-var-edit.png?fit=max\&auto=format\&n=QbQhGRA27C2PmKkr\&q=85\&s=d3d378c83f0523890640bd302f625f35)

### Connections

**1. Edit the connection**

Open the **More actions** menu (⋯) next to the connection, then click **Edit Connection**.

![The More actions menu for a Deployment connection with the Edit Connection option](https://mintcdn.com/astronomer/QbQhGRA27C2PmKkr/images/docs/rotate-credentials-deployment-connection-menu.png?fit=max\&auto=format\&n=QbQhGRA27C2PmKkr\&q=85\&s=98a2c617ddd6824321ea00cc4d20e1c5)

**2. Enter the new values**

Enter the newly generated values for your credential in their respective fields, then click **Update Connection**.

![The Edit Generic Connection dialog showing the connection fields](https://mintcdn.com/astronomer/QbQhGRA27C2PmKkr/images/docs/rotate-credentials-connection-edit.png?fit=max\&auto=format\&n=QbQhGRA27C2PmKkr\&q=85\&s=01e97e6b350198024927eb19fb777257)

> [!NOTE]
>
> The fields in this dialog differ depending on the connection type.

### Airflow variables

**1. Edit the Airflow variable**

Open the **More actions** menu (⋯) next to the Airflow variable, then click **Edit Airflow Variable**.

![The Airflow Variables sub-tab of a Deployment listing each variable with a More actions menu](https://mintcdn.com/astronomer/QbQhGRA27C2PmKkr/images/docs/rotate-credentials-deployment-airflow-var-list.png?fit=max\&auto=format\&n=QbQhGRA27C2PmKkr\&q=85\&s=9fe008bfe6e71b50ac875b4f7f6308de)

**2. Enter the new value**

In the **Airflow Variable Value** field, enter the newly generated value for your credential, then click **Update Airflow Variable**.

![The Edit Airflow Variable dialog showing the Airflow Variable Value field](https://mintcdn.com/astronomer/QbQhGRA27C2PmKkr/images/docs/rotate-credentials-deployment-airflow-var-edit.png?fit=max\&auto=format\&n=QbQhGRA27C2PmKkr\&q=85\&s=adfe571592c2d5ae633ca7a7fd6d83f8)
