What is the benefit of swapping compared to deploying conditionally with Azure Deployment Slots

163 views Asked by At

Despite the obvious of swapping back immediately when your boss goes "what the ..", ( but that shouldn't really happen with all the DevOps galore of slots should it? ) it's difficult for me to see the benefit of swapping compared to conditional pipelines that deploy according to branch e.g committing to "staging" branch deploys to "staging" slot, "main" branch deploys to "production" slot etc.

I see the following pitfalls with swapping compared to conditional deployment in pipeline:

  • I have to manually ensure my "main" branch is "synced" with the "production" slot
  • I have to manually run the "staging" pipeline to ensure the "staging" slot is "synced" with the "staging" branch, causing the staging slot to be "down" in a substantial amount of time

Not really in the spirit of DevOps is it?

Am I missing something?

1

There are 1 answers

2
Dasari Kamali On

What is the benefit of swapping compared to deploying conditionally with Azure Deployment Slots

Conditional Pipelines:

enter image description here

When you commit/push changes to the master branch, the pipeline configured with master branch will trigger and deploys the application code to the configured slot automatically.
It means you don’t have to sync the branches with slots manually.

However, you can define multi-stage environment or same tasks multiple times. Like, Once staging environment is deployed and tested successfully, an user can approve for next stage deployment that does the functionality of deploying/swapping to another slot. This method potentially reduces the downtime.

Slot Swapping Technique - Manual Process:

enter image description here

You need to ensure main branch is pointing to the production slot accurately and when you want to sync the “staging” slot with the “staging” branch, you might need to perform swaps or synchronize operation, that leads to downtime in the staging environment.

Ultimately, choosing one of them depends on a few factors such as the deployment process, testing, requirements and how you manage synchronization and downtime.

Conditional Pipelines allows you to have fine-grained control which means defining & execute specific stages or jobs in your pipeline based on conditions (defined in the variables, expressions, outcome of previous jobs) .