Hello @Tri Nguyen
One thing to note is that the Function
attribute should be applied to a method, not a class. In your example, you have applied the attribute to the TimeIntervalFunctionClass
class, which might be causing the issue. Instead, you should define a public method inside the class and apply the Function
attribute to that method. Here's an example of how you can define a public method inside the TimeIntervalFunctionClass
class and apply the Function
attribute to that method:
open Microsoft.Azure.Functions.Worker
open Microsoft.Extensions.Logging
type TimeIntervalFunctionClass() = []
member this.Run ([] myTimer: TimerInfo) (context: FunctionContext) =
let logger = context.GetLogger() logger.LogInformation("finally")
In this example, the Run
method is marked with the Function
attribute and takes a TimerInfo
parameter and a FunctionContext
parameter. The TimerTrigger
attribute is applied to the myTimer
parameter to specify the timer trigger schedule. The FunctionContext
parameter is used to get a logger instance, which can be used to log information.
I hope that this response has addressed your query and helped you overcome your challenges. If so, please mark this response as Answered. This will not only acknowledge our efforts, but also assist other community members who may be looking for similar solutions.