问题
I am new to Microsoft Azure Application Insights and need some help on getting user information (Login ID, number of times user logged into application, etc). I went through another similar stack overflow post Getting User Information in App Insights , but it did not helped me.
I have already setup Application Insights and getting the default data presented by Azure itself.
Request your help on the same.
Thanks in advance.
回答1:
We did something similar to this using custom properties in our platform - this will be available for grouping in Azure portal as well.
Achievable by TrackPageViews in client side using AI script. With a small tweak:
appInsights.trackPageView("module_name", "serverUrl", {User: "UserName", DomainName: "Alias" });
Reference-Blog post written here: https://docs.microsoft.com/en-us/azure/application-insights/app-insights-sample-mscrm
回答2:
for something like "number times user logged into application" could be as simple as
union customEvents, pageViews
| where timestamp > ago(14d)
| summarize numSessions = dcount(session_Id) by user_Id
| top 100 by numSessions
(or in english, "in the last 14 days, show me top 100 users by how many sessions they have in events and page views")
depending on what telemetry you're sending, you'd adjust what tables you are using, what date/time ranges you want, if you want specific events or pages by names, etc.
or, you could use the Usage features in the portal, which can show you this kind of information.
来源:https://stackoverflow.com/questions/44320728/user-information-with-application-insights