Windows Azure 诊断扩展 (WAD) 配置架构版本和历史记录Windows Azure Diagnostics extension (WAD) configuration schema versions and history

本文提供了作为 Microsoft Azure SDK 的一部分提供的 Windows Azure 诊断扩展 (WAD) 架构版本的历史记录。This article provides the version history of the Azure Diagnostics extension for Windows (WAD) schema versions shipped as part of the Microsoft Azure SDK.

Azure SDK 和诊断版本随附图Azure SDK and diagnostics versions shipping chart

Azure SDK 版本Azure SDK version 诊断扩展版本Diagnostics extension version 型号Model
1.x1.x 1.01.0 插件plug-in
2.0 - 2.42.0 - 2.4 1.01.0 插件plug-in
2.52.5 1.21.2 扩展extension
2.62.6 1.31.3 ""
2.72.7 1.41.4 ""
2.82.8 1.51.5 ""
2.92.9 1.61.6 ""
2.962.96 1.71.7 ""
2.962.96 1.81.8 ""
2.962.96 1.8.11.8.1 ""
2.962.96 1.91.9 ""
2.962.96 1.111.11 ""

Azure 诊断 1.0 版本最初随附于插件模型中,也就是说,安装 Azure SDK 时,便可获取附带的 Azure 诊断版本。Azure Diagnostics version 1.0 first shipped in a plug-in model -- meaning that when you installed the Azure SDK, you got the version of Azure diagnostics shipped with it.

从 SDK 2.5(诊断版本 1.2)开始,Azure 诊断随附于扩展模型中。Starting with SDK 2.5 (diagnostics version 1.2), Azure diagnostics went to an extension model. 使用新功能的工具仅在较新版本的 Azure SDK 中可用,但使用 Azure 诊断的任何服务都将直接从 Azure 选取最新的附带版本。The tools to utilize new features were only available in newer Azure SDKs, but any service using Azure diagnostics would pick up the latest shipping version directly from Azure. 例如,仍在使用 SDK 2.5 的任何用户在使用较新功能时都将加载上表中显示的最新版本。For example, anyone still using SDK 2.5 would be loading the latest version shown in the previous table, regardless if they are using the newer features.

架构索引Schemas index

不同版本的 Azure 诊断使用不同的配置架构。Different versions of Azure diagnostics use different configuration schemas. 架构 1.0 和 1.2 已弃用。Schema 1.0 and 1.2 have been deprecated. 有关版本 1.3 及更高版本的详细信息,请参阅诊断 1.3 及更高版本的配置架构For more information on version 1.3 and later, see Diagnostics 1.3 and later Configuration Schema

版本历史记录Version history

诊断扩展 1.11Diagnostics extension 1.11

添加了对 Azure Monitor 接收器的支持。Added support for the Azure Monitor sink. 此接收器仅适用于性能计数器。This sink is only applicable to performance counters. 允许将在 VM、VMSS 或云服务上收集的性能计数器作为自定义指标发送到 Azure Monitor。Enables sending performance counters collected on your VM, VMSS, or cloud service to Azure Monitor as custom metrics. Azure Monitor 接收器支持:The Azure Monitor sink supports:

  • 通过 Azure Monitor 指标 API 检索发送到 Azure Monitor 的所有性能计数器。Retrieving all performance counters sent to Azure Monitor via the Azure Monitor metrics APIs.
  • 通过 Azure Monitor 中新的统一警报体验根据发送到 Azure Monitor 的所有性能计数器发出警报Alerting on all performance counters sent to Azure Monitor via the new unified alerts experience in Azure Monitor
  • 将性能计数器中的通配符运算符视为指标上的“实例”维度。Treating wildcard operator in performance counters as the "Instance" dimension on your metric. 例如,如果你收集了“LogicalDisk(*)/DiskWrites/sec”计数器,则可以根据“实例”维度进行筛选和拆分,以基于每个逻辑磁盘(C:、D:等)的磁盘写入次数/秒进行绘图或发出警报For example if you collected the "LogicalDisk(*)/DiskWrites/sec" counter you would be able to filter and split on the "Instance" dimension to plot or alert on the Disk Writes/sec for each Logical Disk (C:, D:, etc.)

将 Azure Monitor 定义为诊断扩展配置中的新接收器Define Azure Monitor as a new sink in your diagnostics extension configuration

"SinksConfig": {
    "Sink": [
        {
            "name": "AzureMonitorSink",
            "AzureMonitor": {}
        },
    ]
}
<SinksConfig>  
  <Sink name="AzureMonitorSink">
      <AzureMonitor/>
  </Sink>
</SinksConfig>

备注

为经典 VM 和经典云服务配置 Azure Monitor 接收器需要在诊断扩展的专用配置中定义更多参数。Configuring the Azure Monitor sink for Classic VMs and Classic CLoud Service requires more parameters to be defined in the Diagnostics extension's private config.

有关更多详细信息,请参阅详细的诊断扩展架构文档For more details please reference the detailed diagnostics extension schema documentation.

接下来,可以将性能计数器配置为路由到 Azure Monitor 接收器。Next, you can configure your performance counters to be routed to the Azure Monitor Sink.

"PerformanceCounters": {
    "scheduledTransferPeriod": "PT1M",
    "sinks": "AzureMonitorSink",
    "PerformanceCounterConfiguration": [
        {
            "counterSpecifier": "\\Processor(_Total)\\% Processor Time",
            "sampleRate": "PT1M",
            "unit": "percent"
        }
    ]
},
<PerformanceCounters scheduledTransferPeriod="PT1M", sinks="AzureMonitorSink">  
  <PerformanceCounterConfiguration counterSpecifier="\Processor(_Total)\% Processor Time" sampleRate="PT1M" unit="percent" />  
</PerformanceCounters>

诊断扩展 1.9Diagnostics extension 1.9

添加了 Docker 支持。Added Docker support.

诊断扩展 1.8.1Diagnostics extension 1.8.1

可以在专用配置中指定 SAS 令牌而非存储帐户密钥。如果提供了 SAS 令牌,则会忽略存储帐户密钥。Can specify a SAS token instead of a storage account key in the private config. If a SAS token is provided, the storage account key is ignored.

{
    "storageAccountName": "diagstorageaccount",
    "storageAccountEndPoint": "https://core.chinacloudapi.cn",
    "storageAccountSasToken": "{sas token}",
    "SecondaryStorageAccounts": {
        "StorageAccount": [
            {
                "name": "secondarydiagstorageaccount",
                "endpoint": "https://core.chinacloudapi.cn",
                "sasToken": "{sas token}"
            }
        ]
    }
}
<PrivateConfig>
    <StorageAccount name="diagstorageaccount" endpoint="https://core.chinacloudapi.cn" sasToken="{sas token}" />
    <SecondaryStorageAccounts>
        <StorageAccount name="secondarydiagstorageaccount" endpoint="https://core.chinacloudapi.cn" sasToken="{sas token}" />
    </SecondaryStorageAccounts>
</PrivateConfig>

诊断扩展 1.8Diagnostics extension 1.8

向 PublicConfig 中添加了 StorageType。Added Storage Type to PublicConfig. StorageType 可以是 TableBlobTableAndBlobStorageType can be Table, Blob, TableAndBlob. Table 是默认值。Table is the default.

{
    "WadCfg": {
    },
    "StorageAccount": "diagstorageaccount",
    "StorageType": "TableAndBlob"
}
<PublicConfig>
    <WadCfg />
    <StorageAccount>diagstorageaccount</StorageAccount>
    <StorageType>TableAndBlob</StorageType>
</PublicConfig>

诊断扩展 1.7Diagnostics extension 1.7

添加了路由到 EventHub 的功能。Added the ability to route to EventHub.

诊断扩展 1.5Diagnostics extension 1.5

添加了 sinks 元素和将诊断数据发送到 Application Insights 的功能,因此可以更轻松地在应用程序以及系统和基础结构级别诊断问题。Added the sinks element and the ability to send diagnostics data to Application Insights making it easier to diagnose issues across your application as well as the system and infrastructure level.

Azure SDK 2.6 和诊断扩展 1.3Azure SDK 2.6 and diagnostics extension 1.3

对 Visual Studio 中的云服务项目进行了以下更改。For Cloud Service projects in Visual Studio, the following changes were made. (这些更改同样适用于更高版本的 Azure SDK。)(These changes also apply to later versions of Azure SDK.)

  • 本地模拟器现在支持诊断。The local emulator now supports diagnostics. 此更改意味着,在 Visual Studio 中开发和测试时,可以收集诊断数据并确保应用程序正在创建相应的跟踪。This change means you can collect diagnostics data and ensure your application is creating the right traces while you're developing and testing in Visual Studio. 使用 Azure 存储模拟器在 Visual Studio 中运行云服务项目时,连接字符串 UseDevelopmentStorage=true 可启用诊断数据收集。The connection string UseDevelopmentStorage=true enables diagnostics data collection while you're running your cloud service project in Visual Studio by using the Azure Storage Emulator. 所有诊断数据都在“(开发存储)”存储帐户中收集。All diagnostics data is collected in the (Development Storage) storage account.
  • 诊断存储帐户连接字符串 (Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString) 将再次存储在服务配置 (.cscfg) 文件中。The diagnostics storage account connection string (Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString) is stored once again in the service configuration (.cscfg) file. 在 Azure SDK 2.5 中,在 diagnostics.wadcfgx 文件中指定诊断存储帐户。In Azure SDK 2.5 the diagnostics storage account was specified in the diagnostics.wadcfgx file.

连接字符串在 Azure SDK 2.4 及更早版本中的工作方式与它在 Azure SDK 2.6 中的工作方式之间有一些明显的差异。There are some notable differences between how the connection string worked in Azure SDK 2.4 and earlier and how it works in Azure SDK 2.6 and later.

  • 在 Azure SDK 2.4 及更早版本中,诊断插件在运行时使用连接字符串获取用于传输诊断日志的存储帐户信息。In Azure SDK 2.4 and earlier, the connection string was used at runtime by the diagnostics plugin to get the storage account information for transferring diagnostics logs.
  • 在 Azure SDK 2.6 及更高版本中,Visual Studio 在发布过程中通过诊断连接字符串使用相应的存储帐户信息来配置诊断扩展。In Azure SDK 2.6 and later, Visual Studio uses the diagnostics connection string to configure the diagnostics extension with the appropriate storage account information during publishing. 借助连接字符串,可以为 Visual Studio 在发布时使用的不同服务配置定义不同的存储帐户。The connection string lets you define different storage accounts for different service configurations that Visual Studio will use when publishing. 但是,因为诊断插件已不再可用(在 Azure SDK 2.5 之后),.cscfg 文件本身不能启用诊断扩展。However, because the diagnostics plugin is no longer available (after Azure SDK 2.5), the .cscfg file by itself can't enable the Diagnostics Extension. 必须通过工具(如 Visual Studio 或 PowerShell)单独启用扩展。You have to enable the extension separately through tools such as Visual Studio or PowerShell.
  • 为了简化使用 PowerShell 配置诊断扩展的过程,Visual Studio 的程序包输出还包含每个角色的诊断扩展的公共配置 XML。To simplify the process of configuring the diagnostics extension with PowerShell, the package output from Visual Studio also contains the public configuration XML for the diagnostics extension for each role. Visual Studio 使用诊断连接字符串来填充公共配置中存在的存储帐户信息。Visual Studio uses the diagnostics connection string to populate the storage account information present in the public configuration. 公共配置文件在“扩展”文件夹中创建,并遵循模式 PaaSDiagnostics.<RoleName>.PubConfig.xmlThe public config files are created in the Extensions folder and follow the pattern PaaSDiagnostics.<RoleName>.PubConfig.xml. 任何基于 PowerShell 的部署都可以使用此模式将每个配置映射到角色。Any PowerShell based deployments can use this pattern to map each configuration to a Role.
  • .cscfg 文件中的连接字符串还由 Azure 门户用于访问诊断数据,使这些数据可以显示在“监视”选项卡中。 需要连接字符串才能配置服务,从而在门户中显示详细监视数据。The connection string in the .cscfg file is also used by the Azure portal to access the diagnostics data so it can appear in the Monitoring tab. The connection string is needed to configure the service to show verbose monitoring data in the portal.

将项目迁移到 Azure SDK 2.6 和更高版本Migrating projects to Azure SDK 2.6 and later

从 Azure SDK 2.5 迁移到 Azure SDK 2.6 或更高版本时,如果在 .wadcfgx 文件中指定了诊断存储帐户,则该帐户将继续保留在那里。When migrating from Azure SDK 2.5 to Azure SDK 2.6 or later, if you had a diagnostics storage account specified in the .wadcfgx file, then it will stay there. 要针对不同存储配置充分使用不同存储帐户的灵活性,必须手动将连接字符串添加到项目。To take advantage of the flexibility of using different storage accounts for different storage configurations, you'll have to manually add the connection string to your project. 如果将项目从 Azure SDK 2.4 或更低版本迁移到 Azure SDK 2.6,系统将保留诊断连接字符串。If you're migrating a project from Azure SDK 2.4 or earlier to Azure SDK 2.6, then the diagnostics connection strings are preserved. 但是,请注意 Azure SDK 2.6 中处理连接字符串的方式的更改,如上一部分中所述。However, note the changes in how connection strings are treated in Azure SDK 2.6 as specified in the previous section.

Visual Studio 如何确定诊断存储帐户How Visual Studio determines the diagnostics storage account

  • 如果在 .cscfg 文件中指定了诊断连接字符串,则 Visual Studio 在发布时以及在打包过程中生成公共配置 xml 文件时会使用它来配置诊断扩展。If a diagnostics connection string is specified in the .cscfg file, Visual Studio uses it to configure the diagnostics extension when publishing, and when generating the public configuration xml files during packaging.
  • 如果未在 .cscfg 文件中指定任何诊断连接字符串,则 Visual Studio 在发布时以及在打包过程中生成公共配置 xml 文件时将回退到使用 .wadcfgx 文件中指定的存储帐户来配置诊断扩展。If no diagnostics connection string is specified in the .cscfg file, then Visual Studio falls back to using the storage account specified in the .wadcfgx file to configure the diagnostics extension when publishing, and generating the public configuration xml files when packaging.
  • .cscfg 文件中的诊断连接字符串优先于 .wadcfgx 文件中的存储帐户。The diagnostics connection string in the .cscfg file takes precedence over the storage account in the .wadcfgx file. 如果在 .cscfg 文件中指定了诊断连接字符串,则 Visual Studio 使用该字符串,而忽略 .wadcfgx 中的存储帐户。If a diagnostics connection string is specified in the .cscfg file, then Visual Studio uses that and ignores the storage account in .wadcfgx.

“更新开发存储连接字符串...”复选框的作用What does the "Update development storage connection strings…" checkbox do?

“在发布到 Azure 时使用 Azure 存储帐户凭据更新诊断和缓存的开发存储连接字符串”复选框提供了使用发布过程中指定的 Azure 存储帐户更新任何开发存储帐户连接字符串的简便方法。The checkbox for Update development storage connection strings for Diagnostics and Caching with Azure storage account credentials when publishing to Azure gives you a convenient way to update any development storage account connection strings with the Azure storage account specified during publishing.

例如,假设你选中此复选框,并且诊断连接字符串指定 UseDevelopmentStorage=trueFor example, suppose you select this checkbox and the diagnostics connection string specifies UseDevelopmentStorage=true. 将项目发布到 Azure 时,Visual Studio 将自动使用发布向导中指定的存储帐户更新诊断连接字符串。When you publish the project to Azure, Visual Studio will automatically update the diagnostics connection string with the storage account you specified in the Publish wizard. 但是,如果已将实际的存储帐户指定为诊断连接字符串,则将改用该帐户。However, if a real storage account was specified as the diagnostics connection string, then that account is used instead.

Azure SDK 2.4 及更早版本与 Azure SDK 2.5 及更高版本之间的诊断功能差异Diagnostics functionality differences between Azure SDK 2.4 and earlier and Azure SDK 2.5 and later

如果要将项目从 Azure SDK 2.4 升级到 Azure SDK 2.5 或更高版本,则应考虑到以下诊断功能差异。If you're upgrading your project from Azure SDK 2.4 to Azure SDK 2.5 or later, you should bear in mind the following diagnostics functionality differences.

  • 配置 API 已弃用 – 诊断的编程配置在 Azure SDK 2.4 或更早版本中可用,但在 Azure SDK 2.5 及更高版本中已弃用。Configuration APIs are deprecated - Programmatic configuration of diagnostics is available in Azure SDK 2.4 or earlier versions, but is deprecated in Azure SDK 2.5 and later. 如果目前在代码中定义了诊断配置,则需在已迁移的项目中从头开始重新配置这些设置,这样才能让诊断正常工作。If your diagnostics configuration is currently defined in code, you'll need to reconfigure those settings from scratch in the migrated project in order for diagnostics to keep working. Azure SDK 2.4 的诊断配置文件是 diagnostics.wadcfg,而 Azure SDK 2.5 及更高版本的诊断配置文件是 diagnostics.wadcfgx。The diagnostics configuration file for Azure SDK 2.4 is diagnostics.wadcfg, and diagnostics.wadcfgx for Azure SDK 2.5 and later.
  • 云服务应用程序的诊断只能在角色级别配置,而不是在实例级别配置。Diagnostics for cloud service applications can only be configured at the role level, not at the instance level.
  • 每次部署应用时,都会更新诊断配置 – 如果从服务器资源管理器更改诊断配置并重新部署应用,这可能会导致奇偶校验问题。Every time you deploy your app, the diagnostics configuration is updated - This can cause parity issues if you change your diagnostics configuration from Server Explorer and then redeploy your app.
  • 在 Azure SDK 2.5 及更高版本中,故障转储是在诊断配置文件而非代码中配置的 – 如果在代码中配置了故障转储,则必须手动将配置从代码传输至配置文件,因为故障转储并未在迁移至 Azure SDK 2.6 的过程中传输。In Azure SDK 2.5 and later, crash dumps are configured in the diagnostics configuration file, not in code - If you have crash dumps configured in code, you'll have to manually transfer the configuration from code to the configuration file, because the crash dumps aren't transferred during the migration to Azure SDK 2.6.