【问题标题】:Enable Azure PaaS Diagnostics sdk 2.8启用 Azure PaaS 诊断 sdk 2.8
【发布时间】:2016-03-24 14:51:03
【问题描述】:

尝试在 azure 中启用对工作角色的 paas 诊断 这是我尝试过的: 1、在VS2015中,右键角色并启用诊断。结果:1 分钟后超时。试了几次。 2. 使用powershell启用:

$storage_name = "mystorageaccount"
$key = "typedstoragekeyhere"
$publicconfigpath = "C:\Temp\diagnostics.wadcfgx"
$servicename = "cloudservicename"
$storageContext = New-AzureStorageContext -StorageAccountName $storage_name -StorageAccountKey $key
Set-AzureServiceDiagnosticsExtension -StorageContext $storageContext -DiagnosticsConfigurationPath $publicconfigpath -ServiceName $servicename -Slot Production

结果:Set-AzureServiceDiagnosticsExtension:BadRequest:扩展公共配置... ...对架构无效 其次是

在底部: + CategoryInfo : NotSpecified: (:) [Set-AzureServiceDiagnosticsExtension], CloudException + FullyQualifiedErrorId : Hyak.Common.CloudException,Microsoft.WindowsAzure.Commands.ServiceManagement.Extensions.SetAzureServiceDiagnosticsExtensionCommand

我错过了什么?

【问题讨论】:

    标签: azure diagnostics


    【解决方案1】:
    1. 创建辅助角色时,Visual Studio 会自动启用 Diagnostics 1.0 作为解决方案的一部分,因此您需要先禁用它。右键单击 Worker 角色 > 属性 > 配置,然后取消选中启用诊断

    2. 通过执行以下 PowerShell 命令下载公共配置文件架构定义:

      (Get-AzureServiceAvailableExtension -ExtensionName 'PaaSDiagnostics' -ProviderNamespace 'Microsoft.Azure.Diagnostics').PublicConfigurationSchema | Out-File -Encoding utf8 -FilePath 'WadConfig.xsd'

    3. 将 XML 文件添加到您的 WorkerRole 项目并进行您自己的诊断配置,然后将我们在第 2 步中获得的 WadConfig.xsd 与该 xml 文件相关联。

    4. 运行以下命令:

      $storage_name = "storageName"
      $key = "StorageAccountKey"
      $config_path="the xml path created in step 3"
      $service_name="serviceName"
      $storageContext = New-AzureStorageContext -StorageAccountName $storage_name -StorageAccountKey $key
      Set-AzureServiceDiagnosticsExtension -StorageContext $storageContext -DiagnosticsConfigurationPath $config_path -ServiceName $service_name -Slot Staging -Role WorkerRole1
      

    现在,PaaS 诊断扩展已为您的辅助角色启用。查看更多详情here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-08-25
      • 1970-01-01
      • 2019-04-22
      • 1970-01-01
      • 2022-11-13
      • 1970-01-01
      • 2017-06-04
      相关资源
      最近更新 更多