适用于 Windows 的网络观察程序代理虚拟机扩展Network Watcher Agent virtual machine extension for Windows

概述Overview

Azure 网络观察程序是一项网络性能监视、诊断和分析服务,可以对 Azure 网络进行监视。Azure Network Watcher is a network performance monitoring, diagnostic, and analytics service that allows monitoring of Azure networks. 网络观察程序代理虚拟机扩展是按需捕获网络流量和运行 Azure 虚拟机上的其他高级功能所必需的。The Network Watcher Agent virtual machine extension is a requirement for capturing network traffic on demand, and other advanced functionality on Azure virtual machines.

本文档详细介绍适用于 Windows 的网络观察程序代理虚拟机扩展支持的平台和部署选项。This document details the supported platforms and deployment options for the Network Watcher Agent virtual machine extension for Windows. 安装代理时不会中断,也不会需要重新启动虚拟机。Installation of the agent does not disrupt, or require a reboot, of the virtual machine. 可以将扩展部署到你部署的虚拟机中。You can deploy the extension into virtual machines that you deploy. 如果虚拟机由 Azure 服务部署,请查看该服务的文档以确定它是否允许在虚拟机中安装扩展。If the virtual machine is deployed by an Azure service, check the documentation for the service to determine whether or not it permits installing extensions in the virtual machine.

先决条件Prerequisites

操作系统Operating system

可以在 Windows Server 2008 R2、2012、2012 R2、2016 和 2019 版本中运行适用于 Windows 的网络观察程序代理扩展。The Network Watcher Agent extension for Windows can be run against Windows Server 2008 R2, 2012, 2012 R2, 2016 and 2019 releases. 目前不支持 Nano Server。Nano Server is not supported at this time.

Internet 连接Internet connectivity

某些网络观察程序代理功能要求将目标虚拟机连接到 Internet。Some of the Network Watcher Agent functionality requires that the target virtual machine be connected to the Internet. 如果不能建立传出连接,网络观察程序代理将不能将数据包捕获上传到存储帐户。Without the ability to establish outgoing connections, the Network Watcher Agent will not be able to upload packet captures to your storage account. 有关更多详细信息,请参阅网络观察程序文档For more details, please see the Network Watcher documentation.

扩展架构Extension schema

以下 JSON 显示网络观察程序代理扩展的架构。The following JSON shows the schema for the Network Watcher Agent extension. 该扩展既不需要也不支持任何用户提供的设置,而是依赖于其默认配置。The extension neither requires, nor supports, any user-supplied settings, and relies on its default configuration.

{
    "type": "extensions",
    "name": "Microsoft.Azure.NetworkWatcher",
    "apiVersion": "[variables('apiVersion')]",
    "location": "[resourceGroup().location]",
    "dependsOn": [
        "[concat('Microsoft.Compute/virtualMachines/', variables('vmName'))]"
    ],
    "properties": {
        "publisher": "Microsoft.Azure.NetworkWatcher",
        "type": "NetworkWatcherAgentWindows",
        "typeHandlerVersion": "1.4",
        "autoUpgradeMinorVersion": true
    }
}

属性值Property values

名称Name 值/示例Value / Example
apiVersionapiVersion 2015-06-152015-06-15
publisherpublisher Microsoft.Azure.NetworkWatcherMicrosoft.Azure.NetworkWatcher
typetype NetworkWatcherAgentWindowsNetworkWatcherAgentWindows
typeHandlerVersiontypeHandlerVersion 1.41.4

模板部署Template deployment

可使用 Azure 资源管理器模板部署 Azure VM 扩展。You can deploy Azure VM extensions with Azure Resource Manager templates. 可以在 Azure 资源管理器模板中使用上一部分中详细介绍的 JSON 架构,以便在 Azure 资源管理器模板部署过程中运行网络观察程序代理扩展。You can use the JSON schema detailed in the previous section in an Azure Resource Manager template to run the Network Watcher Agent extension during an Azure Resource Manager template deployment.

PowerShell 部署PowerShell deployment

可以使用 Set-AzVMExtension 命令将网络观察程序代理虚拟机扩展部署到现有的虚拟机:Use the Set-AzVMExtension command to deploy the Network Watcher Agent virtual machine extension to an existing virtual machine:

Set-AzVMExtension `
  -ResourceGroupName "myResourceGroup1" `
  -Location "ChinaNorth" `
  -VMName "myVM1" `
  -Name "networkWatcherAgent" `
  -Publisher "Microsoft.Azure.NetworkWatcher" `
  -Type "NetworkWatcherAgentWindows" `
  -TypeHandlerVersion "1.4"

故障排除和支持Troubleshooting and support

故障排除Troubleshooting

可以从 Azure 门户和 PowerShell 检索有关扩展部署状态的数据。You can retrieve data about the state of extension deployments from the Azure portal and PowerShell. 若要查看给定 VM 的扩展部署状态,请使用 Azure PowerShell 模块运行以下命令:To see the deployment state of extensions for a given VM, run the following command using the Azure PowerShell module:

Get-AzVMExtension -ResourceGroupName myResourceGroup1 -VMName myVM1 -Name networkWatcherAgent

扩展执行输出记录到在以下目录中发现的文件:Extension execution output is logged to files found in the following directory:

C:\WindowsAzure\Logs\Plugins\Microsoft.Azure.NetworkWatcher.NetworkWatcherAgentWindows\

支持Support

如果对本文中的任何内容不了解,可以参阅网络观察程序用户指南文档或联系 Azure 支持上的 Azure 专家。If you need more help at any point in this article, you can refer to the Network Watcher User Guide documentation or contact the Azure experts on the Azure support. 或者,也可以提出 Azure 支持事件。Alternatively, you can file an Azure support incident. 请转到 Azure 支持站点提交请求。Go to the Azure support site and submit your request. 有关使用 Azure 支持的信息,请阅读 Azure 支持常见问题For information about using Azure Support, read the Azure support FAQ.