Logging Custom Properties from Dataverse Plugin to Application Insights
Taking the Application Insights Integration Further
How do you handle custom logging when writing dataverse plugins?
Some implementations rely on the plugin trace available out of the box.
While this works and pretty easy to implement, we can get more benefits using Application Insights in Azure.
Some benefits:
- It is searchable.
- Isolated from the Dataverse environment.
- Custom properties can be specified.
All you need is the Microsoft.Xrm.Sdk.PluginTelemetry;
This functionality requires that the Application Insights resource must have been connected to the Dataverse environment.
For example, If I wanted to log some custom properties, I could create a custom object TelemetryProperties to hold the properties and do the following.
That’s it.