Forum Discussion
Application insight dll is not sending Telemetry data
# Update the path if you install a different version of AI NuGet package
Add-Type -Path .\Microsoft.ApplicationInsights.dll;
$InstrumentationKey = "xxxxx";
$endpointAddress = "https://dc.services.visualstudio.com/v2/track"
# Create a telemetry client and configuration object
$telemetryConfig =[Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration]::CreateDefault()
$telemetryConfig.InstrumentationKey = $InstrumentationKey
$telemetryConfig.TelemetryChannel.EndpointAddress = $endpointAddress
$telemetryClient = [Microsoft.ApplicationInsights.TelemetryClient]::new($telemetryConfig)
# Send a trace log to Application Insights
$telemetryClient.TrackTrace("Hello from DEv!")
# Flush the telemetry channel to ensure all data is sent
$telemetryClient.Flush()
Above code is not sending logs to azure ! am i missing something here? How do i test InstrumentationKey connection is right ?