I use Microsoft.Azure.Management.Fluent
SDK package for accessing Azure Monitor metrics like this:
var credentials = SdkContext.AzureCredentialsFactory
.FromServicePrincipal("some-client-id", "some-client-secret", "some-tenant-id", AzureEnvironment.AzureGlobalCloud);
var azure = Microsoft.Azure.Management.Fluent.Azure
.Configure()
.Authenticate(credentials)
.WithSubscription("my-subscription");
foreach (var metricDefinition in azure.MetricDefinitions.ListByResource("my-resource-uri"))
{
...
}
It works fine for common metrics (Application Insights standard metrics). But how can I get my custom events with this SDK to render them in my custom app dashboard? I see recorded events in Application Insights dashboard under "Log-based metrics", but ListByResource method doesn't return them.