Swapping Slots - CDCgov/prime-simplereport GitHub Wiki

Quick refresher on how the API is deployed

Our deployments operate in a staged rollout. Each environment has a staging slot and an active slot. When a deployment action takes place, the following steps occur:

  • The CI/CD pipeline runs initial code and structure tests.
  • Terraform changes are applied to the environment.
  • The new version of the app service is deployed to the staging slot.
  • The staging slot is checked for health and stability.
  • When stable, the staging slot is swapped with the active slot. This means that the staging slot, with the new code, becomes the active slot and receives all traffic.

As a beneficial side effect of this procedure, the known-good production configuration remains active in the staging slot until another deployment is made. If a malfunctioning feature or some other code problem prevents proper application startup, the change can be quickly reverted by executing a manual slot swap.

Perform a slot swap

This process has been automated using our GitHub actions. To perform a slot swap, go to the workflow corresponding to the environment you're having issues with and click to run the workflow using the main branch. The slow swap job swaps the staging slot with the production slot and checks the environment's readiness.

If this job fails or you need additional information, consult Microsoft's official documentation.