Forum Discussion
Racheal200
Apr 27, 2023Copper Contributor
Application insight dll is not sending Telemetry data
Hi,
I have created a custom availability test using application insight dll and powershell with reference to
Ref: https://swimburger.net/blog/azure/run-availability-tests-using-powershell-and-azure-application-insights
it was working fine but since Mar 31st data are not sent to azure on a scheduled interval... There's no issue with the script because data is available twice or thrice in a day as you can see the data in chart
But here's the chart before Mar 31st
I have no clue to figure out this issue.. was there any upgrade on Mar 31st which has caused this glitch?
To test the endpoint address ,I have tried to send the trace logs to Azure Application Insights using the Application Insights SDK using below script and it worked yesterday as soon as i run this script i could see the logs in azure . But today when i run this script i cant see the logs in azure.
# Load the Application Insights SDK assembly Add-Type -Path "C:\path\to\Microsoft.ApplicationInsights.dll"
# Set the instrumentation key and endpoint for your Application Insights resource $instrumentationKey = "YOUR_INSTRUMENTATION_KEY"
$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 PowerShell!")
# Flush the telemetry channel to ensure all data is sent
$telemetryClient.Flush()
Sampling is not enabled in application insight resource and there are enough space available .
- Racheal200Copper Contributor
# 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 ?