Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to run code when a Azure function's Hub is starting?

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?

like image 509
gabomgp Avatar asked Aug 03 '17 21:08

gabomgp


1 Answers

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
    }
}
like image 193
Mikhail Shilkov Avatar answered Nov 19 '22 17:11

Mikhail Shilkov