Search code examples
azure-devopsazure-functionsazure-pipelinesazure-functions-runtimeazure-deployment-slots

How to avoid hosting restart when deploying Azure Functions with deployment slot?


I configured pipeline to do zero down time deployment for Azure Functions. For that purpose I have following steps:

  • create slot
  • deploy to slot
  • start swap with preview
  • complete swap

My understanding of this is process is that all restarts should happen only on preview slot (so only JobHost should be restarted) and this should have a place before final swap. However, I noticed on Application Insight that Hosting stopped which result in on 503 code when I was hitting function. Is there away of avoiding this? I'm not sure if it matters but I use Premium plan.


Solution

  • I was able to achieve zero downtime deployment setting variable WEBSITE_ADD_SITENAME_BINDINGS_IN_APPHOST_CONFIG to 1. For more info you can take a look here. One drwaback of this is slowness on processing requests during deployment.

    I also recommend to follow this github issue where is discussion about zer/miniam downtime deployment.