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
stagingslot. - The
stagingslot is checked for health and stability. - When stable, the
stagingslot is swapped with theactiveslot. This means that thestagingslot, with the new code, becomes theactiveslot 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.
- Production slot swap workflow
- Stg slot swap workflow
- Training slot swap workflow
- Demo slot swap workflow
- Test slot swap workflow
- Dev slot swap workflow
This GitHub action resolves the following error message:
If this job fails or you need additional information, consult Microsoft's official documentation.