简体   繁体   English

Application Insights 自部署到 Azure Web 应用程序后没有数据

[英]Application Insights No data since deployed to Azure web app

I'm using Azure Application Insights.我正在使用 Azure Application Insights。 After some config steps followed by official documents, I found my application insights works fine on my local build.经过一些配置步骤和官方文档之后,我发现我的应用程序洞察力在我的本地构建上运行良好。 The data of Request, Exception, Dependency and Custom Event all appear in azure portal. Request、Exception、Dependency 和 Custom Event 的数据都出现在 Azure 门户中。

However, as soon as I deploy it to Azure web app, I cannot see any Application Insights data in azure portal.但是,一旦我将其部署到 Azure Web 应用程序,我就无法在 Azure 门户中看到任何 Application Insights 数据。

I've verified that the Application Insights Dlls and Microsoft.Diagnostics.Tracing.EventSource.dll are both copied to azure according to the "No (server) data since I published the app to my server" part of this article: https://azure.microsoft.com/en-us/documentation/articles/app-insights-asp-net-troubleshoot-no-data/#q03我已经验证了 Application Insights Dlls 和 Microsoft.Diagnostics.Tracing.EventSource.dll 都根据本文的“自从我将应用程序发布到我的服务器”部分的“无(服务器)数据”部分复制到 azure: https:/ /azure.microsoft.com/en-us/documentation/articles/app-insights-asp-net-troubleshoot-no-data/#q03

Some other strange things is, when I remote debug my azure web app, I found all TelemetryClient appears "not configured", however My Instrumentation key write correctly in ApplicationInsights.config其他一些奇怪的事情是,当我远程调试我的 azure Web 应用程序时,我发现所有 TelemetryClient 都显示为“未配置”,但是我的 Instrumentation 密钥在 ApplicationInsights.config 中正确写入

One more thing is, when I change code like this:还有一件事是,当我像这样更改代码时:

var client = new TelemetryClient();
client.Context.InstrumentationKey = "The Key";
client.TrackEvent("TestEvent");

The Custom Events comes out in Azure portal.自定义事件出现在 Azure 门户中。 But other data like Request, Exception, Dependencies are not recorded in portal automatically.但是请求、异常、依赖项等其他数据不会自动记录在门户中。

What's wrong with my Application?我的应用程序有什么问题?

Under the help of an azure support engineer, the problem has been solved.在 azure 支持工程师的帮助下,问题已经解决。

The cause is that in App Setting in the azure portal, there is a config sets "MOBILESERVICESDOTNET_EXTENSION_VERSION" = 1.0.478原因是在 azure 门户的 App Setting 中,有一个配置集 "MOBILESERVICESDOTNET_EXTENSION_VERSION" = 1.0.478

After delete this config, everything works fine.删除此配置后,一切正常。

But I'm still not sure the root cause of that.但我仍然不确定其根本原因。 Why this config can cause so much trouble?为什么这个配置会造成这么大的麻烦?

It sounds like you are recording telemetry where you have control over the TelemetryClient - like in your code sample above.听起来您正在记录遥测数据,您可以控制 TelemetryClient - 就像上面的代码示例一样。

With that in mind, there are a few things for you to check:考虑到这一点,您需要检查以下几点:

  • The applicationinsights.config is configured with your instrumentation key. applicationinsights.config 使用您的检测密钥进行配置。
  • The applicationinsights.config is being deployed to WebApps applicationinsights.config 正在部署到 WebApps
  • All the necessary telemetry modules are in your web.config所有必要的遥测模块都在您的 web.config 中

Since you're receiving telemetry locally, I would say this is as simple as you not deploying the applicationinsights.config file.由于您在本地接收遥测数据,我想说这就像您不部署 applicationinsights.config 文件一样简单。

I found additional troubleshooting help in Kudo, at https://.scm.azurewebsites.net/ApplicationInsights我在 Kudo 中找到了其他故障排除帮助,位于 https://.scm.azurewebsites.net/ApplicationInsights

I ended up actually removing all code that does the Application Insights integration (including deleting ApplicationInsights.config), and instead letting the app service handle that automatically.我最终实际上删除了所有执行 Application Insights 集成的代码(包括删除 ApplicationInsights.config),而是让应用服务自动处理这些代码。 I might not be a solution for op due to custom events, bur for standard tracking it worked like a charm.由于自定义事件,我可能不是操作的解决方案,对于标准跟踪来说,它就像一个魅力。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 针对部署到多个环境的Web App的VS Application Insights - VS Application Insights for a Web App deployed to multiple environments Web API + Azure App Insights将数据从ActionFilter传递到ITelemetryProcessor - Web API + Azure App Insights pass the data from ActionFilter to ITelemetryProcessor 从应用程序洞察(Azure 门户)获取数据以将其显示在 asp.net Web 应用程序的网页上 - Fetching data from Application insights (Azure Portal) to display it on a web page in asp.net web application Web 部署在 Azure 上的应用程序未返回 UTC 日期时间 - Web App deployed on Azure not returning datetimes in UTC 当应用程序部署为 Azure Web 应用程序时,OnTokenValidated 事件未触发,但在本地运行时触发 - OnTokenValidated event not firing when application is deployed as Azure Web App, but fires when running locally 是否可以对Function App和Web App使用单个Application Insights实例 - Is it possible to use single Application Insights instance for a Function App and a Web App Windows应用商店崩溃崩溃未在Application Insights Azure门户中记录 - Windows store app crashes not get logged in Application Insights azure portal 部署在Azure Web App / Azure API上时缺少CORS标头 - CORS headers missing when deployed on Azure Web App / Azure API 检测Application Insights是否(以及为什么)可以将遥测数据发送到Azure - Detecting whether or not (and why) Application Insights can send telemetry data to Azure 需要澄清:从 Azure Functions 将数据记录到 Application Insights - Need Clarification : Logging data in to Application Insights from Azure Functions
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM