How can I call a function from one file to another file csx csx window azure Microsoft Windows?

How can we create another run.csx and cause existing function from one file to another in csx azure application functions for Microsoft applications?

+5
source share
1 answer

You can just write another file, for example. lib.csx and upload it through #load "lib.csx" in the main file script. See. Here Document

As an example, put this in your run.csx

 #load "lib.csx" using System; public static void Run(TimerInfo myTimer, TraceWriter log) { log.Info($"C# Timer trigger function executed at: {DateTime.Now}"); log.Info(doubleTheInt(5).ToString()); } TraceWriter log) #load "lib.csx" using System; public static void Run(TimerInfo myTimer, TraceWriter log) { log.Info($"C# Timer trigger function executed at: {DateTime.Now}"); log.Info(doubleTheInt(5).ToString()); } function executed at: {DateTime.Now}"); #load "lib.csx" using System; public static void Run(TimerInfo myTimer, TraceWriter log) { log.Info($"C# Timer trigger function executed at: {DateTime.Now}"); log.Info(doubleTheInt(5).ToString()); } 

and that lib.csx

 using System; public static int doubleTheInt(int x) { return x*x; } { using System; public static int doubleTheInt(int x) { return x*x; } 

and he shall bring 25 in the journal

+6
source

All Articles