I want to run code when the Azure Function's hub is starting and to be sure that's executed before any Azure function can be called in that hub. Can I do that?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Given your are using precompiled C# functions, you could put your initialization code into static constructor:
public static class MyFunctionApp
{
static MyFunctionApp()
{
// Runs once when class is first loaded
}
public void Run([SomeTrigger] input)
{
// Runs on each event
}
}