Custom Event arguments are not retrieved
See original GitHub issueI am trying to retrieve custom event data from Application Insights using this package: https://www.nuget.org/packages/Microsoft.Azure.ApplicationInsights
The custom event names are being correctly deserialized, but the custom event data (which is passed via a TelemetryClient object in another solution) isn’t. The data is available in the Azure portal, so there is either a bug in the API surface being used by this library or (more likely) the deserialization code.
Expected: EventsCustomEventResult.CustomDimensions and EventsCustomEventResult.CustomMeasurements are not null (ideally the additional properties should contain a list of string names and string pairs, respectively).
Actual: The object is null for custom events that do contain custom properties.
Repro: Ensure that custom events with additional properties exist in an ApplicationInsights instance (This is easily done with the TelemetryClient) and then run this code:
var activeDirectoryServiceSettings = new ActiveDirectoryServiceSettings
{
AuthenticationEndpoint = new Uri("https://login.microsoftonline.com"),
TokenAudience = new Uri("https://api.applicationinsights.io/"),
ValidateAuthority = true
};
var serviceCredentials = ApplicationTokenProvider.LoginSilentAsync(
domain: "< DOMAIN >",
clientId: "< CLIENT ID >",
secret: "< SECRET >",
settings: activeDirectoryServiceSettings)
.GetAwaiter()
.GetResult();
_applicationInsightsDataClient = new ApplicationInsightsDataClient(serviceCredentials)
{
AppId = "< APP ID >"
};
var events = _applicationInsightsDataClient.GetCustomEvents(TimeSpan.FromHours(72));
foreach (var e in events.Value)
{
// EXPECTED:
// e.CustomDimensions.AdditionalProperties != null
// e.CustomMeasurements.AdditionalProperties != null
}
.NET Core SDK (reflecting any global.json): Version: 3.1.402 Commit: 9b5de826fd
Runtime Environment: OS Name: Windows OS Version: 10.0.19041 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\3.1.402\
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (5 by maintainers)
Top GitHub Comments
The documentation has been updated. https://www.nuget.org/packages/Microsoft.Azure.ApplicationInsights has been deprecated.
@geneh It looks like the same fix which was applied to EventsResultDataCustomDimensions in 58a48f0 needs to be applied to EventsResultDataCustomMeasurements as well.