What is the best practice to enable maintenance page in Sitecore Azure PaaS webapp? Also is there a way we can switch on maintenance page such as app_offline in application settings. I m looking at more automated way that can just save time without using option such as FTP publish or Kudu changes.
-
I hope all your app must be in your company or client's network and a firewall system must be in place. If yes you can deploy a maintenance web app in free tier with all your maintenance pages. You can configure rules on your firewall, if site is down or any planned maintenance is happening, redirect to the page in your maintenance web app.– AlokBhattJul 8, 2017 at 7:33
1 Answer
Using Maintenance Slots to Eliminate Deployment Downtime
Rather than use a maintenance page, you can actually avoid downtime in Azure by using multiple deployment slots. Think of this kind of like Content Search indexes with Solr or Lucene, using SwitchOnRebuild. Basically, you have (at least) two slots: one for your live site and another for a maintenance site that is essentially an exact duplicate of production. When you go to deploy, you deploy to the "maintenance slot", leaving the site in the "production slot" untouched and unaffected. Once the deployment is complete, you can start the maintenance site, thus initializing it so that it runs without any slowdown and once ready you can swap it with the site in the production slot. You would then update the site that was formerly in the production slot so that it matches what is now in production.
Adding in Support for a Rollback Plan
Improving upon this, you could use three slots to provide the ability to immediately rollback if the situation calls for it. To do so, you would deploy to two maintenance slots, warm one up for production and upon swapping the warmed maintenance site in you would leave the site that was formerly in the production slot (now swapped out) as-is. This means that if an issue occurs, you can quickly swap the old production site - still unmodified - back in to effectively roll back the deployment.
Credit
Tamas Varga deserves much of the credit for this post, including the additional references.
More information:
- Read about zero downtime deployment by Bas Lijten: http://blog.baslijten.com/zero-downtime-deployments-with-sitecore-on-azure/
- Read about Blue-Green deployment on Azure by Rob Habraken: https://www.robhabraken.nl/index.php/2740/blue-green-sitecore-deployments-on-azure/
-
I just saw that in the Sitecore 8.2.3 azure release a maintance mode has been included. Not a best practice imho, but it's there ;) Jul 7, 2017 at 15:51
-
@BasLijten I saw that too, but I haven't seen much about it. If you've used it or if your familiar with the feature you should post an answer about that too! It may not be a best practice, but it would certainly be an alternative option. Jul 7, 2017 at 15:52
-
@ZacharyKniebel What in case we have integration with api that transact with enterprise data and this service is down for mainteance purpose and we can't allow end users to view site. Jul 9, 2017 at 6:18
-
@ZacharyKniebel Thanks for the detailed explanation..What would be your design approach if we have integration with downstream or upstream application? Jul 9, 2017 at 6:33
-
I think that those questions would be better asked on Sitecore Slack than in comments on SSE. You can reach me at @zachary_kniebel Jul 9, 2017 at 16:00