3
votes

I have two slots Prod and PreProd. How do I swap slots in azure devops release pipeline? The first one is deploying to preprod after success then it is going to approval if approved then going to deploy to production. But I need to swap slots between preprod and prod.

enter image description here

3

3 Answers

4
votes

You need to define two steps:

  • deploy to deployment slot
  • and swap slot

enter image description here

To deploy to deployment slot you need to mark it and provide slot name:

enter image description here

And next in swap step define action which is Swap Slots and which slot is going to be swapped:

enter image description here

And please read this blog entry if you are going to make swaps between preprod and prod environments. He disadvices this approach. And I fully agree with him.

3
votes

You can use the Azure App Service Manage Task.

App Service Manage Task

0
votes
  1. Stage 1 -> With Deploy Azure App Service deploy to dev/pre-prod slot.
  2. Clone State 1.
  3. Add a post-deployment condition to Stage 1 for approval.
  4. Remove Deploy Azure App Service task and add Azure App Service Manage task to Stage 2 to swap with production.