How do I turn on “always-on” for an Azure Function?

萝らか妹 提交于 2019-11-27 03:11:12

问题


I have a Function App with 3 functions, one of them timer-triggered every 2 minutes. I observed that after a while, the function stops being triggered, but restarts when I go to the portal.

As I understand it, the reason is that by default, "Always On" is turned off. However, when I go to Application Settings / General Settings, I cannot activate the "On" state, which is grayed out. I can un-check "Off", which doesn't seem to stick or activate "On".

Am I missing something obvious? Is Always-On the solution to my problem, or is there something else I should do?

Note: the functions are written in F#; I doubt it matters, but I thought I would mention it just in case.


回答1:


This answer applies to all Azure Function scenarios with the exception of those that are triggered by an http request.

There are 3 cases to look at:

  1. You have a Function App running in a Free/Shared App Service Plan: Always On is not available, and those scenarios are simply not supported.
  2. You have a Function App running in a Basic/Standard/Premium App Service Plan: Always On is available and can be turned on. In fact it is on by default, and you'll get a warning in the Functions UI if you turn it off.
  3. You have a Function App using a Consumption Plan: there is no need for Always On as the system takes care of waking up your functions whenever they need to run. This is the recommended approach for most users.



回答2:


Azure Functions are managed together by Azure App Service which restricts always on to modes that are Basic or above (no free or shared)

In Basic or Standard mode, you can enable Always On to keep the app loaded all the time.



来源:https://stackoverflow.com/questions/39430932/how-do-i-turn-on-always-on-for-an-azure-function

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