【Azure 应用服务】更便捷的方式抓取Azure App Service for Windows的网络包

简介: 【Azure 应用服务】更便捷的方式抓取Azure App Service for Windows的网络包

问题描述

在之前的一篇博文中,介绍了在App Service中抓取网络日志:

  1. 抓取Windows的网络包:【应用服务 App Service】App Service中抓取网络日志
  2. 抓取Linux的网络包:【Azure 应用服务】App Service For Linux 如何在 Web 应用实例上住抓取网络日志

现在,随着App Service的更新,Linnx也可以直接登录到SSH而不在需要复杂的配置操作。同时Windows环境中,也不在需要在本地安装 armclient.exe工具,而是直接通过 App Service的门户完成抓取,下载操作。

 

操作步骤

第一步: 进入App Service的Overview页面,点击“Diagnose and solve problems”, 然后再选择“ Diagnostic Tools” 方块

(注意: Diagnostic Tools路径变动,查看下图中的步骤)

 

第二步:选择 Collect Network Trace , 并设定抓取日志的时间长度, 60秒 ~ 15分钟的值供选择。页面中也对抓取网络日志的情况进行了说明:

Collect a Network Trace

If your app is facing issues while connecting to a remote server, you can use this tool to collect a network trace on the instance(s) serving the Web App.

Analyzing network traces is complex and time consuming task. Before collecting a network trace, please make sure you understand that you really need to collect a network trace to troubleshoot the problem.

What you should know before collecting a Network Trace

  • 网络日志帮助定位TCP丢包,检查App Service与其他服务之间的HTTP通信情况(Network traces are helpful to troubleshoot TCP packet loss and to check HTTP communication that your App is making with the remote endpoints.)
  • 在开始抓取网络日志后,要在App Service上重新我们需要抓包解决的问题(After the network trace is started, you should reproduce the problem so that outbound traffic from your App gets captured in the trace.)
  • 如果适用HTTPS,那么数据将被加密(If the remote endpoints are called over TLS or SSL (i.e. HTTPS), then the traffic in the trace will be encrypted.)
  • 将会收集应用所在的全部实例上的网络包(Network traces are collected on all the instance(s) serving your App.)
  • 抓取网络日志只包含当前正在运行进程。当抓取网络包开始后,新的进程的网络包将不被抓取(Traces are captured only of processes that are running when the trace is started. The trace does not capture packets of any processes that start after the capture is started.)
  • 可以适用Network Monitor和Wireshark工具对网络包进行分析(To analyze the Network Trace, you need tools like Network Monitor or Wireshark that can open the network captures.)

 

第三步:等待抓取时间完成,页面会直接显示网络包的下载地址。点击即可。

PS:此处不需要在登录到Kudu站点中,到 c:\home\logfiles\networktrace 目录中进行下载,但是如果要查看历史的网络抓包文件,还是需要到Kudu站点中下载。

 

 

注意:当前App Service For Linux环境,还是不支持以上方式抓包。 需要SSH,然后执行以下命令:

tcpdump -i any host <your app service inbound ip address> and tcp port 443 -n -v -s 0 -w /tmp/appnetworktrace.pcap  

 

[END]

相关文章
|
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天前
|
开发框架 JavaScript 前端开发
【App Service】解决 .NET Profiler 报告打开后无数据加载的问题
【App Service】解决 .NET Profiler 报告打开后无数据加载的问题
|
10天前
|
网络安全 虚拟化 Windows
windows 11安装openSSH server 遇到的"kex_exchange_identification: read: Connection reset"问题
windows 11安装openSSH server 遇到的"kex_exchange_identification: read: Connection reset"问题
|
20天前
|
PHP Windows
【Azure App Service for Windows】 PHP应用出现500 : The page cannot be displayed because an internal server error has occurred. 错误
【Azure App Service for Windows】 PHP应用出现500 : The page cannot be displayed because an internal server error has occurred. 错误
|
30天前
|
开发框架 .NET API
Windows Server 2022 安装IIS 报错 访问临时文件夹 C:\WINDOWS\TEMP\3C 读取/写入权限 错误: 0x80070005
Windows Server 2022 安装IIS 报错 访问临时文件夹 C:\WINDOWS\TEMP\3C 读取/写入权限 错误: 0x80070005
64 0
|
1月前
|
Linux Docker Windows
Windows——Docker拉取Windows Server镜像
Windows——Docker拉取Windows Server镜像
98 0