---
title: "Update Managed Cloud"
slug: "update-managed-cloud"
abstract: "Learn how to update your solution with the latest changes."
---
# Update Managed Cloud

Managed Cloud Containers lets you install the MCC package with the latest updates. This is an important process for keeping an implementation current with the latest advances for Managed Cloud Containers. We recommend that you plan these updates as part of your regular maintenance plans and, for example, schedule time for MCC updates monthly.

To learn more about the content of an update package, refer to the release notes. The release notes for every package are available from the same location as the upgrade package (`release_notes.<mcc package version>.md`).

> [!important]
> Sitecore Managed Cloud Containers solution can be updated only if it supports a modularized repository structure. Modularized structure is supported starting from versions `10.1.0-r.182868` and `10.1.1-r.182925`. To check your version, go to the Application repository and check the version of your `version.txt` file. If you have an earlier version, you must follow the [migration process](https://doc.sitecore.com/xp/en/developers/102/managed-cloud/walkthrough--migrating-to-the-modular-repository-structure.html "Walkthrough: Migrating to the modular repository structure"). If you have the `solution.json` file, your environment already uses a modularized structure and you can continue the upgrade process described in this topic.

To update your Managed Cloud solution, you must first prepare the update, update the infrastructure, then update the application.

This topic describes how to:

1. [Prepare the update](https://doc.sitecore.com/xp/en/developers/102/managed-cloud/update-managed-cloud.html#UUID-5e80e95b-38b2-0dc3-0433-12115dc51f99_N1636554454701 "Prepare the update")
2. [Update the infrastructure](https://doc.sitecore.com/xp/en/developers/102/managed-cloud/update-managed-cloud.html#UUID-5e80e95b-38b2-0dc3-0433-12115dc51f99_N1636552363701 "Update the infrastructure")
3. [Update the application](https://doc.sitecore.com/xp/en/developers/102/managed-cloud/update-managed-cloud.html#UUID-5e80e95b-38b2-0dc3-0433-12115dc51f99_N1636552371380 "Update the application")
4. [Revert an update](https://doc.sitecore.com/xp/en/developers/102/managed-cloud/update-managed-cloud.html#UUID-5e80e95b-38b2-0dc3-0433-12115dc51f99_section-idm460503305338083273105661312 "Revert an update")

## Prepare the update

To prepare the update:

1. Go to the [`mccsharedupgradestorage`](https://portal.azure.com/#blade/Microsoft_Azure_Storage/ContainerMenuBlade/overview/storageAccountId/%2Fsubscriptions%2F06841065-b1ff-4f84-bf1c-f13d07c59810%2FresourceGroups%2Fmcc-shared-upgrade-storage-rg%2Fproviders%2FMicrosoft.Storage%2FstorageAccounts%2Fmccsharedupgradestorage/path/mcc-upgrades/etag/%220x8D9468AF8C2CD36%22/defaultEncryptionScope/%24account-encryption-key/denyEncryptionScopeOverride//defaultId//publicAccessVal/None) storage account, open the `mcc-upgrades` container, and find the latest revision for your topology and Sitecore version:

    `- mcc.{topology}.upgrade.{sitecore_version}-r.{revision}.nupkg` 

    > [!note]
    > If you cannot access the storage account, open a service request for *DevOps Engineer* access.

2. Download and unzip the package to a temporary folder.
3. Review your repositories and look for the customizations you have made:
    - If you want to add new Azure resources, follow the procedure described in the [Configure Managed Cloud](https://doc.sitecore.com/xp/en/developers/102/managed-cloud/configure-managed-cloud.html "Configure Managed Cloud") topic in the [*Add a new infrastructure module*](https://doc.sitecore.com/xp/en/developers/102/managed-cloud/configure-managed-cloud.html#UUID-90c44cc4-704c-04c6-b5bb-0c2cd17a5859_section-idm4519428614003232984576606823 "Add a new infrastructure module") section.
    - For customized files in the Application repository: move the custom files to separate Ansible roles. For example, if you added additional public services, follow the process described in the [Add a public service](https://doc.sitecore.com/xp/en/developers/102/managed-cloud/add-a-public-service.html "Add a public service") topic. If you added monitoring extensions, read the [Add a custom Prometheus alert](https://doc.sitecore.com/xp/en/developers/102/managed-cloud/add-a-custom-prometheus-alert.html "Add a custom Prometheus alert") topic and the [Import and export your Grafana dashboard](https://doc.sitecore.com/xp/en/developers/102/managed-cloud/import-and-export-your-grafana-dashboards.html "Import and export your Grafana dashboards") topic.

## Update the infrastructure

How you update the infrastructure depends on whether your environment has disaster recovery (DR) and the type of disaster recovery.

> [!note]
> If you have customized files, make sure that all custom changes are separated into [different modules](https://doc.sitecore.com/xp/en/developers/102/managed-cloud/update-managed-cloud.html#UUID-5e80e95b-38b2-0dc3-0433-12115dc51f99_N1636554454701 "Prepare the update").

<details>
<summary><h3>Update the infrastructure of an environment that does not have DR</h3></summary>

To update the infrastructure of an environment that does not have DR:

1. Create a feature branch and copy all content of the `Infrastructure` folder to the `Infrastructure` repository except the following folder:
    - `config\resources` 
2. Create a pull request against the main branch. Review and resolve any conflicts.
3. Compare the `config\resources\resources.json` and `sku\resources.{topology-size}.json` files. Update `config\resources\resources.json` if there are any differences in the structure.
4. If you have any other new files added to the pipelines folder, make sure you create a new pipeline in Azure DevOps and link it to the new pipeline `.yaml` file from the pipelines folder. See the [pipelines documentation](https://doc.sitecore.com/xp/en/developers/102/managed-cloud/the-managed-cloud-standard-pipelines.html "The Managed Cloud Standard pipelines") for details.

</details>

<details>
<summary><h3>Update the infrastructure of an environment that has DR Basic Cold Standby</h3></summary>

To update the infrastructure of an environment that has DR Basic Cold Standby:

1. Create a feature branch and copy all content of the `Infrastructure` folder to the `Infrastructure` repository except the following folder:
    - `config\resources` 
2. Create a pull request against the main branch. Review and resolve any conflicts.
3. Compare `config\resources\resources.json` and `sku\resources.{topology-size}.json` files. Update `config\resources\resources.json` if there are any differences in the structure.
4. Make sure that the following files contain the highlighted code:
    - The `/config/remote-mcc-modules/modules.json` file:

        ![d613fc03-3745-4ee6-bcde-6441f2ee18dc.png](https://doc.sitecore.com/api/markdown-image/xp/en/developers/102/managed-cloud/images/d613fc03-3745-4ee6-bcde-6441f2ee18dc.png)

    - The `/pipelines/templates/infrastructure.yaml` file:

        ![DR2.png](https://doc.sitecore.com/api/markdown-image/xp/en/developers/102/managed-cloud/images/DR2.png)

    - The `/main.tf` file:

        ![DR4.png](https://doc.sitecore.com/api/markdown-image/xp/en/developers/102/managed-cloud/images/DR4.png)

    - The `/pipelines/scripts/enable-tls-1dot2.ps1` file:

        ![enable-tls-1dot2_ps1_file_Cold.png](https://doc.sitecore.com/api/markdown-image/xp/en/developers/102/managed-cloud/images/enable-tls-1dot2_ps1_file_Cold.png)

    - The `/pipelines/scripts/update-tags.ps1` file:

        ![image-20240627-031255.png](https://doc.sitecore.com/api/markdown-image/xp/en/developers/102/managed-cloud/images/image-20240627-031255.png)

    - The `/pipelines/update-resource-group-tags.yaml` file:

        ![image-20240627-031132.png](https://doc.sitecore.com/api/markdown-image/xp/en/developers/102/managed-cloud/images/image-20240627-031132.png)

    - The `/pipelines/scripts/managed-identity-access.ps1` file:

        ![image-20240627-033952.png](https://doc.sitecore.com/api/markdown-image/xp/en/developers/102/managed-cloud/images/image-20240627-033952.png)

        The `/pipelines/hadr/geosync/geosync.yaml` file:

        ![37fc2283-4160-41b6-90da-43e8f6e6454c.png](https://doc.sitecore.com/api/markdown-image/xp/en/developers/102/managed-cloud/images/37fc2283-4160-41b6-90da-43e8f6e6454c.png)

5. Make sure that the `/pipelines/infrastructure.yaml` file contains the following highlighted code:

    > [!warning]
    > Check the type of disaster recovery type you have deployed. DR Basic Cold Standby and DR Managed Hot Standby have different `/pipelines/infrastructure.yaml` files. Make sure that you follow the example below that is based on the type of Disaster Recovery you have deployed.

    ![DR Basic Cold Standby /pipelines/infrastructure.yaml](https://doc.sitecore.com/api/markdown-image/xp/en/developers/102/managed-cloud/images/DRBasicColdStandby.png)

6. Add the following snippet to the bottom of the `main_override.tf` file (if the snippet is not already in the file).

    ```csharp
    resource "azurerm_key_vault_secret" "vmss_identity_client_id" {
      count = local.is_dr_run_state ? local.hadr_config.aks.secret_count : 1
    }

    resource "azurerm_key_vault_secret" "redis_password" {
      count = local.is_dr_run_state ? local.hadr_config.redis.secret_count : 1
    }
    ```

    ![/main_override.tf](https://doc.sitecore.com/api/markdown-image/xp/en/developers/102/managed-cloud/images/main_override.png)

7. If it doesn't already exist, add a new secret named `dr-sc-type` with a value of `external`.
8. Complete the pull request. The Infrastructure pipeline will run and apply the changes automatically.
9. Make sure that the infrastructure pipeline run finished successfully.
10. If you have any other new files added to the pipelines folder, make sure you create a new pipeline in Azure DevOps and link it to the new pipeline `.yaml` file from the pipelines folder. See the [pipelines documentation](https://doc.sitecore.com/xp/en/developers/102/managed-cloud/the-managed-cloud-standard-pipelines.html "The Managed Cloud Standard pipelines") for details.

</details>

<details>
<summary><h3>Update the infrastructure of an environment that has DR Managed Hot Standby</h3></summary>

To update the infrastructure of an environment that has DR Managed Hot Standby:

1. Create a feature branch and copy all content of the `Infrastructure` folder to the `Infrastructure` repository except the following folder:
    - `config\resources` 
2. Create a pull request against the main branch. Review and resolve any conflicts.
3. Compare `config\resources\resources.json` and `sku\resources.{topology-size}.json` files. Update `config\resources\resources.json` if there are any differences in the structure.
4. Make sure that the following files contain the highlighted code:
    - The `/config/remote-mcc-modules/modules.json` file:

        ![d613fc03-3745-4ee6-bcde-6441f2ee18dc.png](https://doc.sitecore.com/api/markdown-image/xp/en/developers/102/managed-cloud/images/d613fc03-3745-4ee6-bcde-6441f2ee18dc.png)

    - The `/pipelines/templates/infrastructure.yaml` file:

        ![DR2.png](https://doc.sitecore.com/api/markdown-image/xp/en/developers/102/managed-cloud/images/DR2.png)

    - The `/main.tf` file:

        ![DR4.png](https://doc.sitecore.com/api/markdown-image/xp/en/developers/102/managed-cloud/images/DR4.png)

    - The `/pipelines/scripts/enable-tls-1dot2.ps1` file:

        ![UUID-3d87031a-b541-57a6-88c1-90f5b721580c.png](https://doc.sitecore.com/api/markdown-image/xp/en/developers/102/managed-cloud/images/UUID-3d87031a-b541-57a6-88c1-90f5b721580c.png)

    - The `/pipelines/scripts/update-tags.ps1` file:

        ![image-20240627-031255.png](https://doc.sitecore.com/api/markdown-image/xp/en/developers/102/managed-cloud/images/image-20240627-031255.png)

    - The `/pipelines/update-resource-group-tags.yaml` file:

        ![image-20240627-031132.png](https://doc.sitecore.com/api/markdown-image/xp/en/developers/102/managed-cloud/images/image-20240627-031132.png)

    - The `/pipelines/scripts/managed-identity-access.ps1` file:

        ![image-20240627-033952.png](https://doc.sitecore.com/api/markdown-image/xp/en/developers/102/managed-cloud/images/image-20240627-033952.png)

        The `/pipelines/hadr/geosync/geosync.yaml` file:

        ![37fc2283-4160-41b6-90da-43e8f6e6454c.png](https://doc.sitecore.com/api/markdown-image/xp/en/developers/102/managed-cloud/images/37fc2283-4160-41b6-90da-43e8f6e6454c.png)

5. Make sure that the `/pipelines/infrastructure.yaml` file contains the following highlighted code:

    > [!warning]
    > Check the type of disaster recovery type you have deployed. DR Basic Cold Standby and DR Managed Hot Standby have different `/pipelines/infrastructure.yaml` files. Make sure that you follow the example below that is based on the type of Disaster Recovery you have deployed.

    ![DR Managed Hot Standby /pipelines/infrastructure.yaml](https://doc.sitecore.com/api/markdown-image/xp/en/developers/102/managed-cloud/images/DRHot_standby.png)

6. Add the following snippet to the bottom of the `main_override.tf` file (if the snippet is not already in the file).

    ```csharp
    resource "azurerm_key_vault_secret" "vmss_identity_client_id" {
      count = local.is_dr_run_state ? local.hadr_config.aks.secret_count : 1
    }

    resource "azurerm_key_vault_secret" "redis_password" {
      count = local.is_dr_run_state ? local.hadr_config.redis.secret_count : 1
    }
    ```

    ![/main_override.tf](https://doc.sitecore.com/api/markdown-image/xp/en/developers/102/managed-cloud/images/main_override.png)

7. Create a new Disaster Recovery cluster version upgrade `.yaml` file.

    To create a new DR cluster version upgrade yaml file, copy the following code snippet to a text editor and save the file as `dr-cluster-version-upgrade.yaml`. Then add the yaml file to the infrastructure repository, in the `pipelines` folder.

    Refer to the following structure:

    ```

    trigger:
    none

    parameters:
    - name: kubernetes_version
      type: string

    variables:
      - group: azure-auth-variables
      - group: azure-keyvault-variables

    pool:
      vmImage: "ubuntu-latest"

    jobs:
      - job: Cluster_Upgrade
        displayName: Upgrade Secondary AKS
        timeoutInMinutes: 360
        steps:
          - task: AzureKeyVault@1
            inputs:
              azureSubscription: $(azure_subscription_id)
              KeyVaultName: $(azure_key_vault_name)
              SecretsFilter: '*'
              RunAsPreJob: true
          - task: AzureCLI@2
            inputs:
              azureSubscription: $(azure_subscription_id)
              scriptType: 'pscore'
              scriptLocation: 'scriptPath'
              scriptPath: 'pipelines/scripts/cluster-version-upgrade.ps1'
              arguments: |
                -InfrastructureId $(dr-infrastructure-id) `
                -KubernetesVersion ${{ parameters.kubernetes_version }}
            displayName: Upgrade Secondary AKS cluster

      - job: Reset_Nodepools
        displayName: Reset Secondary Nodepools
        dependsOn: Cluster_Upgrade
        timeoutInMinutes: 360
        steps:
          - task: AzureKeyVault@1
            inputs:
              azureSubscription: $(azure_subscription_id)
              KeyVaultName: $(azure_key_vault_name)
              SecretsFilter: '*'
              RunAsPreJob: true
          - task: AzureCLI@2
            inputs:
              azureSubscription: $(azure_subscription_id)
              scriptType: 'pscore'
              scriptLocation: 'scriptPath'
              scriptPath: 'pipelines/scripts/reset-nodepools-to-default.ps1'
              arguments: |
                -InfrastructureId $(dr-infrastructure-id)
            displayName: Reset Secondary Nodepools to Default State

      - job: Upgrade_Nodepools_Linux
        displayName: Upgrade Secondary Linux Nodepools
        dependsOn: Reset_Nodepools
        variables:
          osType: "Linux"
        timeoutInMinutes: 360
        steps:
          - task: AzureKeyVault@1
            inputs:
              azureSubscription: $(azure_subscription_id)
              KeyVaultName: $(azure_key_vault_name)
              SecretsFilter: '*'
              RunAsPreJob: true
          - task: AzureCLI@2
            inputs:
              azureSubscription: $(azure_subscription_id)
              scriptType: 'pscore'
              scriptLocation: 'scriptPath'
              scriptPath: 'pipelines/scripts/upgrade-nodepools.ps1'
              arguments: |
                -InfrastructureId $(dr-infrastructure-id) `
                -OsType $(osType) `
                -KubernetesVersion ${{ parameters.kubernetes_version }}
            displayName: Upgrade Secondary Linux Nodepools

      - job: Upgrade_Nodepools_Windows
        displayName: Upgrade Secondary Windows Nodepools
        dependsOn: Upgrade_Nodepools_Linux
        variables:
          osType: "Windows"
        timeoutInMinutes: 360
        steps:
          - task: AzureKeyVault@1
            inputs:
              azureSubscription: $(azure_subscription_id)
              KeyVaultName: $(azure_key_vault_name)
              SecretsFilter: '*'
              RunAsPreJob: true
          - task: AzureCLI@2
            inputs:
              azureSubscription: $(azure_subscription_id)
              scriptType: 'pscore'
              scriptLocation: 'scriptPath'
              scriptPath: 'pipelines/scripts/upgrade-nodepools.ps1'
              arguments: |
                -InfrastructureId $(dr-infrastructure-id) `
                -OsType $(osType) `
                -KubernetesVersion ${{ parameters.kubernetes_version }}
            displayName: Upgrade Secondary Windows Nodepools

       - job: Update_Keyvault
        displayName: Update Keyvault
        dependsOn: Upgrade_Nodepools_Windows
        timeoutInMinutes: 360
        steps:
          - task: AzureCLI@2
            inputs:
              azureSubscription: $(azure_subscription_id)
              scriptType: 'pscore'
              scriptLocation: inlineScript
              inlineScript: |
                $keyvaultName = '$(azure_key_vault_name)'
                $kubernetesVersion = "${{ parameters.kubernetes_version }}"
                Write-Host "Update [dr-kubernetes-cluster-version] secret in keyvault [$keyvaultName] to [$kubernetesVersion]"
                az keyvault secret set --name "dr-kubernetes-cluster-version" --vault-name $keyvaultName --value $kubernetesVersion | Out-Null
                Write-Host " Secret has been updated"
            displayName: Update Keyvault Secrets
    ```

    ![MCC folder structure](https://doc.sitecore.com/api/markdown-image/xp/en/developers/102/managed-cloud/images/AKS_1_23_folder_structure.png)

    > [!note]
    > If the code has been removed, go back to the commit with these files in `main` and copy the highlighted code to the files on the feature branch.

8. If it doesn't already exist, add a new secret named `dr-sc-type` with a value of `external`.
9. Complete the pull request. The Infrastructure pipeline will run and apply the changes automatically.
10. Make sure that the infrastructure pipeline run finished successfully.
11. Create a new pipeline named `dr cluster version upgrade`, then link it to the `.yaml` file you created in step 7 and disable continuous integration. See the [pipelines documentation](https://doc.sitecore.com/xp/en/developers/102/managed-cloud/the-managed-cloud-standard-pipelines.html "The Managed Cloud Standard pipelines") for details.

    ![New DR cluster version upgrade pipeline](https://doc.sitecore.com/api/markdown-image/xp/en/developers/102/managed-cloud/images/aks_1_23_upgrade_new_pipeline.png)

12. If you have any other new files added to the pipelines folder, make sure you create a new pipeline in Azure DevOps and link it to the new pipeline `.yaml` file from the pipelines folder. See the [pipelines documentation](https://doc.sitecore.com/xp/en/developers/102/managed-cloud/the-managed-cloud-standard-pipelines.html "The Managed Cloud Standard pipelines") for details.

</details>

## Update the application

How you update the application depends on whether your environment has disaster recovery and the type of disaster recovery.

> [!note]
> If you have customized files, make sure that all custom changes are separated into [different modules](https://doc.sitecore.com/xp/en/developers/102/managed-cloud/update-managed-cloud.html#UUID-5e80e95b-38b2-0dc3-0433-12115dc51f99_N1636554454701 "Prepare the update").

<details>
<summary><h3>Update the application of an environment that does not have DR</h3></summary>

To update the application of an environment that does not have DR:

1. Create a feature branch and copy all content of the Application folder to the Application repository except the following folder:
    - `config\resources` 
2. Compare `config\resources\resources.json` and `sku\resources.{topology-size}.json` files. Update `config\resources\resources.json` if there are any differences in the structure.
3. Create a pull request against the main branch. Review and resolve any conflicts.
4. If you have new files added to the pipelines folder, make sure you create a new pipeline in Azure DevOps and link it to the new pipeline (the yaml file from the pipelines folder). See the [pipelines documentation](https://doc.sitecore.com/xp/en/developers/102/managed-cloud/the-managed-cloud-standard-pipelines.html "The Managed Cloud Standard pipelines") for detail.

    > [!note]
    > If you apply any patches, make sure that your patch scripts are not removed from the repository.

</details>

<details>
<summary><h3>Update the application of an environment that has DR</h3></summary>

To update the application for an environment that has DR:

1. Create a feature branch and copy all content of the Application folder to the Application repository except the following folder:
    - `config\resources` 
2. Compare `config\resources\resources.json` and `sku\resources.{topology-size}.json` files. Update `config\resources\resources.json` if there are any differences in the structure.
3. Make sure that the following files contain the highlighted code:
    - The `/pipelines/templates/application.yaml` file:

        ![/pipelines/templates/application.yaml](https://doc.sitecore.com/api/markdown-image/xp/en/developers/102/managed-cloud/images/APP1.png)

    - The `/main.yaml` file:

        ![main.yaml](https://doc.sitecore.com/api/markdown-image/xp/en/developers/102/managed-cloud/images/APP3.png)

    > [!note]
    > If the code has been removed, go back to the commit with these files in `main` and copy the highlighted code to the files on the feature branch.

4. Make sure that the `/pipelines/application.yaml` file contains the following highlighted code:

    > [!warning]
    > Check the type of disaster recovery type you have deployed. DR Basic Cold Standby and DR Managed Hot Standby have different `/pipelines/application.yaml` files. Make sure that you follow the example below that is based on the type of disaster recovery you have deployed.

    - For DR Basic Cold Standby only:

        ![The /pipelines/application.yaml/pipelines/application.yaml file for DR Basic Cold Standby.](https://doc.sitecore.com/api/markdown-image/xp/en/developers/102/managed-cloud/images/applicationYML_DRBasicCOLD.png)

    - For DR Managed Hot Standby only:

        ![The /pipelines/application.yaml/pipelines/application.yaml file for DR Managed Hot Standby.](https://doc.sitecore.com/api/markdown-image/xp/en/developers/102/managed-cloud/images/applicationYML_managedHOT.png)

5. Create a pull request against the main branch. Review and resolve any conflicts.
6. Make sure that the application pipeline run finished successfully. The application pipeline runs and applies changes automatically.
7. If you have new files added to the pipelines folder, make sure you create a new pipeline in Azure DevOps and link it to the new pipeline (the yaml file from the pipelines folder). See the [pipelines documentation](https://doc.sitecore.com/xp/en/developers/102/managed-cloud/the-managed-cloud-standard-pipelines.html "The Managed Cloud Standard pipelines") for detail.

    > [!note]
    > If you apply any patches, make sure that your patch scripts are not removed from the repository.

</details>

## Revert an update

If you encountered an error during an update, made a mistake, or want to undo an update, you can revert the update and return to the original state.

To revert an update and return to the original state:

1. Revert the pull request for the Infrastructure repository and run Infrastructure and Frontdoor pipelines to apply changes.
2. Revert the pull request for the Application repository and run the Application pipeline to apply changes.