【发布时间】:2016-06-01 02:16:08
【问题描述】:
我正在尝试让我的 Azure 辅助角色的日志显示在 Application Insights 中。当我运行 Get-AzureServiceDiagnosticsExtension 我得到以下...
<PublicConfig
xmlns="http://schemas.microsoft.com/ServiceHosting/2010/10/DiagnosticsConfiguration">
<WadCfg>
<DiagnosticMonitorConfiguration overallQuotaInMB="8192" sinks="applicationInsights.errors">
<DiagnosticInfrastructureLogs scheduledTransferLogLevelFilter="Verbose" />
<PerformanceCounters scheduledTransferPeriod="PT1M">
<PerformanceCounterConfiguration counterSpecifier="\Memory\Available MBytes"
sampleRate="PT3M" />
<PerformanceCounterConfiguration counterSpecifier="\Processor(_Total)\% Processor Time"
sampleRate="PT3M" />
</PerformanceCounters>
<WindowsEventLog scheduledTransferPeriod="PT1M">
<DataSource name="Application!*[System[(Level=1 or Level=2 or Level=3)]]" />
<DataSource name="Windows Azure!*[System[(Level=1 or Level=2 or Level=3 or Level=4)]]" />
</WindowsEventLog>
<EtwProviders sinks="applicationInsights" />
<CrashDumps dumpType="Full">
<CrashDumpConfiguration processName="WaAppAgent.exe" />
<CrashDumpConfiguration processName="WindowsAzureGuestAgent.exe" />
<CrashDumpConfiguration processName="WaWorkerHost.exe" />
<CrashDumpConfiguration processName="DiagnosticsAgent.exe" />
</CrashDumps>
<Logs scheduledTransferPeriod="PT1M" scheduledTransferLogLevelFilter="Verbose" />
<Metrics resourceId="/subscriptions/{My_Subscription_GUID}/resourceGroups/Group/providers/Microsoft.ClassicCompute/domainNames/MyCloudServiceName" />
</DiagnosticMonitorConfiguration>
<SinksConfig>
<Sink name="applicationInsights">
<ApplicationInsights />
<Channels>
<Channel logLevel="Verbose" name="errors" />
</Channels>
</Sink>
</SinksConfig>
</WadCfg>
<StorageAccount>myclassicstorage</StorageAccount>
</PublicConfig>
以下来自使用 Set-AzureServiceDiagnosticsExtension 上传的原始 diagnostics.wadcfgx 文件
<PrivateConfig xmlns="http://schemas.microsoft.com/ServiceHosting/2010/10/DiagnosticsConfiguration">
<StorageAccount name="{myclassicstorage}" key="{MyClassicStorageKey}" endpoint="https://myclassicstorage.blob.core.windows.net/" />
</PrivateConfig>
使用 Azure 存储资源管理器,我可以连接到 myclassicStorage,并且可以在 WADLogsTable 中看到我想要的条目,但是当我转到 Application Insights 时,什么也没有……
所以看起来我的跟踪条目正在存储,但我的 Application Insights 没有从存储中获取数据。
无论如何,问题的答案可能会导致对失败的解释:-
选择“存储帐户”还是“存储帐户(经典)”是否重要?
ServiceConfiguration.Local.cscfg 和 ServiceConfiguration.Cloud.cscfg 中有 Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString 以及 diagnostics.wadcfgx 文件中的 StorageAccount。为什么有 3 个地方可以设置存储,这些地方应该放什么(我已经设置了相同的细节)。
在许多示例中, diagnostics.wadcfgx 文件中的 StorageAccount 的端点设置为 https://core.windows.net 它应该设置为什么?
【问题讨论】:
-
您是否按照此处的说明:azure.microsoft.com/en-us/documentation/articles/… 指定检测密钥?
-
@AlexBulankou 是的,这是我读过的关于该主题的许多页面之一
标签: .net azure azure-worker-roles azure-application-insights