我如何开启“始终在线"功能,的Azure功能? [英] How do I turn on "always-on" for an Azure Function?

查看:88
本文介绍了我如何开启“始终在线"功能,的Azure功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个具有3个功能的功能应用程序,其中每2分钟触发一次计时器.我观察到一段时间后,该功能停止被触发,但是当我进入门户网站时重新启动.

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".

我缺少明显的东西吗?是Always-On解决方案可以解决我的问题,还是还有其他应做的事情?

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

注意:函数是用F#编写的;我怀疑这很重要,但是我想以防万一.

推荐答案

此答案适用于所有Azure Function方案,但由http请求触发的方案除外.

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

有3种情况需要考虑:

  1. 您有在免费/共享的应用程序服务计划中运行的功能应用程序:始终启用"不可用,并且完全不支持这些方案.
  2. 您有在基本/标准/高级应用程序服务计划中运行的功能应用程序:始终开启"可用并且可以打开.实际上,它默认情况下处于打开状态,如果您将其关闭,则会在功能"用户界面中收到警告.
  3. 您有一个使用消费计划的功能应用程序:无需始终开启,因为系统会在需要运行功能时自动唤醒它们.对于大多数用户,这是推荐的方法.
  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.

这篇关于我如何开启“始终在线"功能,的Azure功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆