1

Is their any way to send custom tracking data from Azure Automation to application insight.

Ex:

workflow sample {
    $instrumentationKey = "1234"
    $TelemetryClient = /// how to get the telemetry client based on instrumentation key

    $TelemetryClient.Track("New message")
    $TelemetryClient.Flush()
}

Note: This is from Azure automation and not from standalone script

thor
  • 21,418
  • 31
  • 87
  • 173
  • A Related unanswered question http://stackoverflow.com/questions/35870749/azure-runbook-load-net-assembly-for-application-insight – Prajwal Saini May 05 '16 at 20:08

1 Answers1

1

This worked

workflow sample {
   InlineScript {
     $assemblyPath = "C:\Modules\Global\Azure\Compute\Microsoft.ApplicationInsights.dll"
     [System.Reflection.Assembly]::LoadFrom($assemblyPath)
     $TelClient = New-Object "Microsoft.ApplicationInsights.TelemetryClient"
     $TelClient.InstrumentationKey = "1234"
     $TelClient.TrackEvent("New message")
     $TelClient.Flush
   }
}