【App Service】解决 .NET Profiler 报告打开后无数据加载的问题

简介: 【App Service】解决 .NET Profiler 报告打开后无数据加载的问题

问题描述

App Service上可以收.NET 应用的Profile Trace文件,并且可以自动分析报告。

Collect a Profiler Trace

If your app is down or performing slow, you can collect a profiling trace to identify the root cause of the issue. Profiling is light weight and is designed for production scenarios.

What you should know before collecting a Profiler trace

  • Once the profiler trace is started, reproduce the issue by browsing to the web app.
  • The profiler trace will automatically stop after 60 seconds.
  • If thread report option is enabled, then raw stack traces of threads inside the process will be collected as well.
  • With thread report option, your App may be paused for a few seconds till all the threads are dumped.
  • Your web app will not be restarted as a result of running the profiler.
  • A profiler trace will help to identify issues in an ASP.NET or ASP.NET Core application.

只是,查看的报告中,所以数据均无法显示,如下图:

如何来解决这个问题呢?

 

问题解答

在报告页面中打开“开发者模式”,查看Console日志或者是Networks日志,发现问题是因为 js /css 文件无法访问导致。

GET https://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js net::ERR_CONNECTION_TIMED_OUT

因为中国区Azure所部署的位置位于北京,上海区域。所以无法正常访问 Google API,无法直接获取 angular.min.js 资源。所以可以通过修改html的 js应用路径来解决问题。

第一步:找到一个在中国区Azure可以访问的 1.2.15 版本的 angular.min.js

可以使用 https://cdn.bootcdn.net/ajax/libs/angular.js/1.2.15/angular.min.js 替换 https://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js 

第二步:打开App Service的Kudu站点,进入DebugConsole

寻找 Data/DaaS/Reports/240701_1119225346/240701_1121184125/dw0sdwk00002D/index.html 文件,  然后编辑。 注意 “/240701_1119225346/240701_1121184125/dw0sdwk00002D/” 这部分内容会根据具体的时间,实例名发生变动。

第三步:在HTML文件种替换 angular.min.js

## 把 
 <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script>
## 替换为
 <script src="https://cdn.bootcdn.net/ajax/libs/angular.js/1.2.15/angular.min.js"></script>

 

再次打开 Profiler Report 页面,加载数据成功!

 

参考资料

Angular JS: https://www.bootcdn.cn/angular.js/

Collect .NET Profiler Trace : https://appserviceblog.com/en/collect-net-profiler-trace/

App Service Diagnostics – Profiling an ASP.NET Web App on Azure App Service : https://azure.github.io/AppService/2018/06/06/App-Service-Diagnostics-Profiling-an-ASP.NET-Web-App-on-Azure-App-Service.html

相关文章
|
11天前
|
安全
【Azure App Service】App service无法使用的情况分析
App Service集成子网后,如果子网网段中的剩余IP地址非常少的情况下,会在App Service实例升级时( 先加入新实例,然后在移除老实例 )。新加入的实例不能被分配到正确的内网IP地址,无法成功的访问内网资源。 解决方法就是为App Service增加子网地址, 最少需要/26 子网网段地址。
|
20天前
|
开发框架 .NET Windows
【App Service】在App Service中配置Virtual applications and directories,访问目录中的静态文件报错404
【App Service】在App Service中配置Virtual applications and directories,访问目录中的静态文件报错404
|
20天前
|
安全 网络安全 Windows
【Azure App Service】遇见az命令访问HTTPS App Service 时遇见SSL证书问题,暂时跳过证书检查的办法
【Azure App Service】遇见az命令访问HTTPS App Service 时遇见SSL证书问题,暂时跳过证书检查的办法
【Azure App Service】遇见az命令访问HTTPS App Service 时遇见SSL证书问题,暂时跳过证书检查的办法
|
20天前
|
安全 前端开发 网络安全
【Azure App Service】访问App Service应用报错 SSL: WRONG_VERSION_NUMBER
【Azure App Service】访问App Service应用报错 SSL: WRONG_VERSION_NUMBER
|
20天前
|
存储 Linux 网络安全
【Azure App Service】.NET代码实验App Service应用中获取TLS/SSL 证书 (App Service Linux/Linux Container)
【Azure App Service】.NET代码实验App Service应用中获取TLS/SSL 证书 (App Service Linux/Linux Container)
|
7天前
|
开发框架 前端开发 JavaScript
ASP.NET MVC 教程
ASP.NET 是一个使用 HTML、CSS、JavaScript 和服务器脚本创建网页和网站的开发框架。
20 7
|
5天前
|
存储 开发框架 前端开发
ASP.NET MVC 迅速集成 SignalR
ASP.NET MVC 迅速集成 SignalR
16 0
|
29天前
|
开发框架 前端开发 .NET
ASP.NET MVC WebApi 接口返回 JOSN 日期格式化 date format
ASP.NET MVC WebApi 接口返回 JOSN 日期格式化 date format
29 0
|
30天前
|
开发框架 前端开发 安全
ASP.NET MVC 如何使用 Form Authentication?
ASP.NET MVC 如何使用 Form Authentication?
|
1月前
|
开发框架 .NET
Asp.Net Core 使用X.PagedList.Mvc.Core分页 & 搜索
Asp.Net Core 使用X.PagedList.Mvc.Core分页 & 搜索
79 0