如何开启“永远在线"?对于 Azure 函数? [英] How do I turn on "always-on" for an Azure Function?

查看:17
本文介绍了如何开启“永远在线"?对于 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. 您有一个在免费/共享应用服务计划中运行的函数应用:Always On 不可用,并且根本不支持这些场景.
  2. 您有一个在基本/标准/高级应用服务计划中运行的函数应用:Always On 可用并且可以打开.事实上,它是默认开启的,如果关闭它,您会在 Functions UI 中收到警告.
  3. 您有一个使用 消费计划 的函数应用程序:不需要 Always On,因为系统会在需要运行时唤醒您的函数.这是大多数用户推荐的方法.
  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天全站免登陆