Deployment Slot support within the Application Gateway
The Web App deployment slots are a great feature, really useful however, they don't really work elegantly when the site is protected by an application gateway.
The current behaviour means that the app gateway needs to be “aware” of the active deployment slot, this really isn't something that it should be aware of.
By default, the URLs would be something like:
The application gateway would be configured to listen for client.azurewebsites.com as this is the production URL.
In order to switch staging to be the production site, two steps would be needed, first to make the slot switch and then a secondary step to re-configure the app gateway to send the traffic to the client-staging url rather than just the production one. This in itself is not something that’s easily do-able without having some script to understand the active slot and target slot and then to alter the gateway accordingly. Particularly with the amount of time needed to update the gateway.
It seems as though the app gateway really hasn’t been designed with the app services (in particular deployment slots) in mind.
Looking at the above, it’s not just me ????
Application Gateway backend pools are not natively aware of an App Service's deployment slots. I have to get around this by, instead of targeting a backend pool to type "App Service", I need to target type "IP or FQDN" and then put in the "client-staging.azurewebsites.com" or "client-development.azurewebsites.com" values (if using the original example).
At the very least, make the backend pool App Service target aware of the deployment slots to select in the drop down list.
However, the original poster's (OP) request would be a complete solution: Have the Application Gateways be aware of app service deployment slot swaps so we don't need to manually fuss with App Gateways for slot swaps. App Gateways should be swap-aware.