Search code examples
azure-devopsazure-pipelines

How to "swap" staging and production slots in release pipeline?


Is there a setting in Azure Devops release pipeline to "swap" deployment slots, similar to how it can be done in Azure Portal with source/target?

swap

We have a stage where after the developer has verified the deployment on staging environment, he would want to enable the swapping to production, but I cannot find a setting like that. The only deployment slot setting I came across in Azure Devops is specifying the slot in App Service deployment task, but theres no swapping mechanism that I see...

slot


Solution

  • Yes, this can be achieved in an Azure DevOps release pipeline.

    The only deployment slot setting I came across in Azure Devops is specifying the slot in App Service deployment task...

    Yes, this is the first step - deploy your app to a slot using the above-mentioned task:

    enter image description here

    Then, add a new Azure App Service Manage task to the job:

    enter image description here

    Which you can then configure like:

    enter image description here

    You just need to ensure that the Source Slot points to the same one you've deployed to in the Azure App Service deploy task.