I would like to customize the application insight configuration for an azure function by creating telemetry initializer. My current scope of work is to identify a way to correlate messages sent from an HTTP triggered azure function to another HTTP triggered azure function and for that was trying to follow the help at dzimchuk.net. However I do not see an ApplicationInsights.config in my azure function project. I found the GitHub project that includes an app insight configuration file, and hence not sure how that project was created. Any help would be much appreciated.
4
votes
In this link docs.microsoft.com/en-us/azure/application-insights/… , we know the file is automatically added to your project when you install most versions of the SDK. But in your Github link:github.com/Azure-Samples/functions-customer-reviews/blob/master/… , there is no related Microsoft.ApplicationInsights packages.So it’s really strange why there is a file. Besides, there still are some features not supported about application insight in Azure function.
– Janley Zhang
Yes, for normal projects the file is added when adding the nugget packages. However when adding app insight packages to function projects it is not added. I wonder from where azure functions pick up these settings or if these are at all configurable
– shaswata pal
I hope my answer would be help. It seems that the telemetry initializer just supports in web project(docs.microsoft.com/en-us/azure/application-insights/…) ,there is not related article in Azure function. There is still some features missed in Azure function( like trace dependency authomatically).You could read this article(blogs.msdn.microsoft.com/appserviceteam/2017/05/10/…).
– Janley Zhang
Thanks for your continued help in this regard @JanleyZhang. I see from the link you provided that dependency support is still not there. This partly answers my question. I am still not having an answer to why the github sample project references the .config file. Perhaps there could be some bypass mechanism to extend the function? I am trying to test out that function with few changes. Hence if you don't mind I would still like to keep this thread open.
– shaswata pal
1 Answers
0
votes
Functions v2 has the capability to do this, but it isn't directly supported.
Do not add AddApplicationInsightsTelemetry() to the services collection as it registers services that conflict with services provided by the environment.
Do not register your own TelemetryConfiguration or TelemetryClient if you are using the built-in Application Insights functionality.
Closest I've gotten is this comment on a github issue which tries to preserve the existing functionality.
There are a few others I've seen around but many of them break integrations with Azure Portal such as the Quick Pulse (Live metrics feed) and performance metrics.