Fixed incorrect app insights telemetry key (#26)
* Fixed incorrect app insights telemetry key * Fixed telemetry Name property to match Az standard * Schema adjustments to match Az telemetry Co-authored-by: Dingmeng Xue <dixue@microsoft.com>
This commit is contained in:
Родитель
582be6f99c
Коммит
3d1d9fec92
|
@ -2,7 +2,7 @@ class Constants
|
|||
{
|
||||
static [System.String] $ConfigurationDirectoryName = ".aztoolsmigration"
|
||||
static [System.String] $ConfigurationFileName = "module-preferences.json"
|
||||
static [System.String] $PublicTelemetryInstrumentationKey = "f1e252c1-5cb5-4ddb-8a2a-66e6a16d1c71"
|
||||
static [System.String] $PublicTelemetryInstrumentationKey = "7df6ff70-8353-4672-80d6-568517fed090"
|
||||
static [System.String] $PublicTelemetryIngestionEndpointUri = "https://dc.services.visualstudio.com/v2/track"
|
||||
}
|
||||
|
||||
|
|
|
@ -60,8 +60,10 @@ function Send-PageViewTelemetry
|
|||
|
||||
# prepare the REST request body schema (version 2.x).
|
||||
|
||||
$InstrumentationKeyNoDashes = $InstrumentationKey.Replace('-','')
|
||||
|
||||
$bodyObject = [PSCustomObject]@{
|
||||
'name' = "AppPageViews"
|
||||
'name' = "Microsoft.ApplicationInsights.$InstrumentationKeyNoDashes.PageView"
|
||||
'time' = ([System.DateTime]::UtcNow.ToString('o'))
|
||||
'iKey' = $InstrumentationKey
|
||||
'tags' = [PSCustomObject]@{
|
||||
|
@ -70,7 +72,7 @@ function Send-PageViewTelemetry
|
|||
'data' = [PSCustomObject]@{
|
||||
'baseType' = 'PageViewData'
|
||||
'baseData' = [PSCustomObject]@{
|
||||
'ver' = '2'
|
||||
'ver' = 2
|
||||
'name' = $PageName
|
||||
'duration' = $Duration.ToString()
|
||||
'properties' = $customPropertiesObj
|
||||
|
@ -89,4 +91,4 @@ function Send-PageViewTelemetry
|
|||
|
||||
$null = Invoke-RestMethod -Uri $AppInsightsIngestionEndpoint -Method Post -Headers $headers -Body $bodyAsCompressedJson
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче