Reputation: 30388
Is there a way to display some type of "Maintenance In Progress" message or web page during a swap operation on Azure App Service?
Upvotes: 2
Views: 290
Reputation: 7686
When you swap slots in a Web App, a request is sent to the root of the staging slot before the swap to warm up the instance. There is then an IP switch that occurs, so the swap is instantaneous. The switch doesn't occur until the warm-up requests return.
However, sometimes a single request to the staging slot's root isn't enough to warm up the instance. You can also hit other pages for warm-up by listing them in the web.config file, as follows:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<applicationInitialization>
<add initializationPage="/pagetowarmup1.php" />
<add initializationPage="/pagetowarmup2.php" />
<add initializationPage="/pagetowarmup3.php" />
</applicationInitialization>
</system.webServer>
</configuration>
My guess is that your site isn't fully warm. Try hitting other pages as part of the warm-up before the slot switch. You can read more about this in the Kudu docs on Github here.
The swap should then be instantaneous and you shouldn't see the long delay period before your requests get answered. Then you can sidestep your original question of needing to display a "down for maintenance" page.
Upvotes: 3