Azure Runbook load .Net assembly for application insight
问题 I have requirement where I want to write some metrics to the application insight for monitoring a service at a regular interval. I though that I would write this PowerShell script and schedule it accordingly. Write-Output "Script Start" $PSScriptRoot = Get-Location $AI = "$PSScriptRoot\Microsoft.ApplicationInsights.dll" [Reflection.Assembly]::LoadFile("$AI") $InstrumentationKey = "" $TelClient = New-Object "Microsoft.ApplicationInsights.TelemetryClient" $TelClient.InstrumentationKey =