唤醒 Azure 函数

Wake up Azure Function

我有一个消费计划中的现有 Azure Functions

我正在编写另一个将调用此函数的函数

一旦现有函数为运行,它会处理存储帐户中的文件。

为了处理我的存储帐户中的文件,我们必须手动进入门户并通过导航

"wake up" 功能

有没有办法通过 C# 代码做到这一点?

此功能托管在基于消费的计划中

在无服务器计算中,只要您进行调用,Azure 函数就会 executed/spin 启动,如果您想在一个函数中调用另一个函数,您可以通过 HTTP 调用来完成。

Durable Functions lets you write stateful functions in a serverless environment. There's nothing built-in in Function Apps to call one HTTP function from other functions without actually making the HTTP call paticularly Function Chaining.

这可能正是您正在寻找的解决方案。我在寻找这样的解决方案时遇到了这篇文章 "An Azure Function to keep other Functions/URLs warmed up",还没有尝试过,但我会的。如果您先尝试,请执行 post 结果。

https://www.sharepointnutsandbolts.com/2018/09/Azure-Function-Warmup-Cold-Start.html

我遇到的另一种方法是 "pinging a health endpoint within your Azure Functions through Azure Monitor." 创建一个 URL ping 测试。 https://docs.microsoft.com/en-us/azure/azure-monitor/app/monitor-web-app-availability

我正在尝试这些。希望这有帮助。