When the Azure app-gateway switches to a backup backend pool, the following process takes place:
- The app-gateway continuously monitors the health of the backend pool members by sending periodic health probes.
- If the app-gateway determines that a backend pool member is not functioning correctly and returning errors, it marks that member as unhealthy.
- If the number of unhealthy members in the primary backend pool reaches a configurable threshold, the app-gateway switches to the backup backend pool.
- The app-gateway then sends health probes to the backup pool members and marks any unhealthy members as such.
- If the backup backend pool also has a configurable threshold of unhealthy members, the app-gateway fails over to the next backup pool until all backup pools have been exhausted.
- If all the backend pools are marked unhealthy, the app-gateway stops sending traffic to them and returns an error message to the client.
The app-gateway will also periodically check the health of previously unhealthy pool members and return them to the healthy state when they meet the configured criteria for a healthy backend pool member.