I am using Azure Function
v2. Here is my function that uses the constructor injection:
public sealed class FindAccountFunction
{
private readonl
In addition to registering the class in function Startup class, we would need to add the namespace in host.json
file as well in order to log the messages to App insights. If we don't add it, it will simply log the message to console locally but when deployed on azure, it won't log anything and won't give any error either.
{
"version": "2.0",
"logging": {
"logLevel": {
"FunctionProjectNameSpace.RegisteredClass": "Information"
}
}
}
Sample code here for reference - https://gist.github.com/nareshnagpal06/82c6b4df2a987087425c32adb58312c2