Is it possible to run the code when running the Hub function?

I want to run the code when the Azure Hub starts and make sure it runs before any Azure function can be called on that hub. Can I do it?

+3


source to share


1 answer


Considering that you are using precompiled C # functions, you can put your initialization code in a static constructor:



public static class MyFunctionApp
{
    static MyFunctionApp()
    {
        // Runs once when class is first loaded
    }

    public void Run([SomeTrigger] input)
    {
        // Runs on each event
    }
}

      

+5


source







All Articles