【发布时间】:2019-01-25 00:03:34
【问题描述】:
背景
我有一个 Azure“应用服务”资源和一个链接的“Application Insights”资源。它们通过应用服务的Settings -> Applications settings -> Application settings (key-value table) 链接,我有以下设置:
APPINSIGHTS_INSTRUMENTATIONKEY = <my application insights instrumentation key>APPINSIGHTS_JAVASCRIPT_ENABLED = true
我的应用程序是根 / (site\wwwroot) 的静态文件应用程序,但在 2 个不同的虚拟目录中也有 2 个 Asp.NET 应用程序:
/app1 (site\app1)/app2 (site\app2)
问题
概览页面显示了包含请求、数据等的“指标”数据(第一张图片),但是当我尝试访问 Application Insights 时,没有显示任何数据(第二张图片)。
尝试
我已尝试按照以下两个指南来激活静态页面应用程序的应用洞察:
- http://apmtips.com/blog/2014/12/02/tracking-static-content-with-application-insights-httpmodule/
- http://blog.tylerdoerksen.ca/posts/2018/03/AppInsights-Static-Content
但是,由于根 Bin 文件夹中的 DLL 错误,我收到错误消息。 我尝试了以下变体:
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"> <!-- With and without 'runAllManagedModulesForAllRequests'. -->
<add name="ApplicationInsightsWebTracking"
type="Microsoft.ApplicationInsights.Extensibility.Web.RequestTracking.WebRequestTrackingModule, Microsoft.ApplicationInsights.Extensibility.Web"
preCondition="managedHandler" /> <!-- With and without 'preCondition="managedHandler"'. -->
<!-- And -->
<add name="ApplicationInsightsWebTracking"
type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web"
preCondition="managedHandler"/> <!-- With and without 'preCondition="managedHandler"'. -->
</modules>
</system.webServer>
根据第二篇文章,一旦 Azure 知道它已连接到 AppInsight,这些缺失的 DLL 应该会自动加载。
如果您使用的是 Azure Web 应用程序。 Add the Applications Insights Extension to the Web App。这会将正确的 DLL 添加到您网站的 Bin 目录中。
我尝试按照“监控实时 Azure Web 应用”下的说明进行操作,但文档似乎不完整。
问题
- 为什么数据显示在应用服务的概述中,而不显示在 AppInsight 中?
- 是否可以在 AppInsight 中查看位于根
/的静态文件应用程序的网站遥测数据?
【问题讨论】:
标签: azure iis azure-application-insights