Following the guide of creating the HttpExample for .Net 5 based Azure Functions, I'm failing setting up structured logging.
My relevant code is:
[Function("HttpExample")]
public static HttpResponseData Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", "post")] HttpRequestData req, FunctionContext executionContext)
{
var logger = executionContext.GetLogger("HttpExample");
logger.LogInformation("Example {ExampleValue}", 1001);
I would expect to get a logging record in Application Insights with a customDimensions property prop__ExampleValue, with a value of 1001.
This is however not the case. No matter what I try, I get the log entry as simple string, but not split into custom name/value pairs.
Any help would be highly appreciated.
Thanks in advance,
Dietmar