How to Maintain Log in App insight directly from D365F&O/x++ code
What is Application Insights?
Application Insights, a feature of Azure Monitor, is an extensible Application Performance Management (APM) service for developers and DevOps professionals. Use it to monitor your live applications. It will automatically detect performance anomalies, and includes powerful analytics tools to help you diagnose issues and to understand what users do with your app. It’s designed to help you continuously improve performance and usability.
Application Insights can be used to log:
Events Azure Application Insights Telemetry Data Model – Event Telemetry – Azure Monitor | Microsoft Docs
Exceptions Azure Application Insights Exception Telemetry Data model – Azure Monitor | Microsoft Docs
Requests Data model for request telemetry – Azure Application Insights – Azure Monitor | Microsoft Docs
Metrics Data model for metric telemetry – Azure Application Insights – Azure Monitor | Microsoft Docs
Traces Azure Application Insights Data Model – Trace Telemetry – Azure Monitor | Microsoft Docs
First, we need to create an app in Portal.azure.com using App Insights.
Then register your app insight to your D365FO app.
Goto System Admin -> setup -> Monitoring and telemetry parameter
Open a Boolean as per your requirement. I am maintaining a log for both successful and failed cases.
On the second tab i have to register my LCS/cloud housed machine
i have to goto LCS environment full detail page
and put it into the next tab
After that we have to connect our App insight with D365fo goto 3rd tab.
get the Instrumentationkey & Connection String from your register App insight.
dump it into 3rd tab
Now you have to go to your code and just write a one-line of code to maintain your Success/Failed case.
SysGlobalTelemetry::logEvent(errorLog);
now you can see the Log in the App insight by doing query "CustomEvent".
The log is maintained on App insight it depends on the configuration & on subscription.
Comments
Post a Comment