Deployment slots, when swapped slot will merge back from prod slot?

Bhargav Pasarla 120 Reputation points
2023-12-26T16:51:37.79+00:00

Consider, staging slot is trying to swap with prod slot.

staging have changes and prod needs to have the new changes. when we try to deployment slot swap from staging to prod, Prod will have the new changes from staging and staging will have the old prod version.

Now I need staging also to have the new changes, like the exact replica of prod new version. How it is can be done?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,965 questions
{count} votes

Accepted answer
  1. ajkuma 28,036 Reputation points Microsoft Employee Moderator
    2023-12-27T19:13:41.0333333+00:00

    @Bhargav Pasarla , As Paul suggested, by having separate deployment slots for production, staging, and development, you may test your changes in a non-production environment before deploying them to production.

    Based on my understanding your scenario, if your requirement fits, you may also checkout the following approach:

    You may leverage/perform a swap with preview. This will allow you to validate that the app runs with the swapped settings before completing the swap. During the swap with preview, the source slot is also warmed up before the swap completion, which is desirable for mission-critical applications. If you cancel the swap, the configuration elements will be reapplied to the source slot.

    To swap with preview, you can follow the steps in Swap deployment slots but select Perform swap with preview. The dialog box shows you how the configuration in the source slot changes in phase 1, and how the source and target slot change in phase 2. When you're ready to start the swap, select Start Swap.

    After the swap, the staging slot will have the new changes from the production slot, and the production slot will have the old version from the staging slot. If the changes swapped into the production slot aren't as you expect, you can perform the same swap immediately to get your "last known good site" back.

    Checkout : What happens during a swap || Swap operation steps

    Additionally, Auto swap streamlines the deployment process by automatically swapping the app into production after it's warmed up in the source slot. When auto swap is enabled from a slot into production, every time you push your code changes to that slot, App Service automatically swaps the app into production after it's warmed up in the source slot.

    After you configure auto swap, every time you push your code changes to the source slot, App Service automatically swaps the app into the target slot after it's warmed up in the source slot.

    Note that auto swap isn't supported in web apps on Linux and Web App for Containers. Also, make sure to test auto swap on a non-production target slot before configuring it for the production slot.

    Please let us know if you have any further questions or if I have misunderstood your ask or provide more info about your exact requirement.


1 additional answer

Sort by: Most helpful
  1. Paul Stoner 6 Reputation points
    2023-12-26T19:51:48.27+00:00

    I do this by having the following deployment slots: production, staging, and development. I then make sure the development slot has the exact same code base as staging (before the swap to production), and then I simply swap the development slot with staging.

    I'm not certain there is another way to accomplish this

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.