Azure Function: Old code still running after a deployment

為{幸葍}努か 提交于 2021-01-28 03:09:14

问题


Right now I again faced the issue that old code is used on an Azure Function App even after the zip deployment through KUDU returns success.

Of course, that is after some 30 mins that I expect the new code to get loaded, not immediately.

The issue is marked as closed.

What is considered to be the best practice in this case:

  1. Programmatically force the Function App to restart, say, through Azure CLI or Powershell Az modules?
  2. Or there is another way to mitigate the issue?

回答1:


While restarting should fix it, my suggestion would be to enable "Run from package": https://docs.microsoft.com/en-us/azure/azure-functions/run-functions-from-deployment-package. That removes the chance of having old files running as the deployment is atomic.

You'd set an app setting of WEBSITE_RUN_FROM_PACKAGE to 1 and continue deploying the same way you are today. The site will be run directly from that package (wwwroot will appear as read-only in kudu) so there's no unzipping and copying, which may be causing the issue you're having.

Note: it looks like we're still tracking the issue here: https://github.com/Azure/azure-functions-host/issues/2636.



来源:https://stackoverflow.com/questions/54555159/azure-function-old-code-still-running-after-a-deployment

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!