Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
启用Azure PaaS诊断sdk 2.8_Azure_Diagnostics - Fatal编程技术网

启用Azure PaaS诊断sdk 2.8

启用Azure PaaS诊断sdk 2.8,azure,diagnostics,Azure,Diagnostics,正在尝试对azure中的工作角色启用paas诊断 以下是我尝试过的: 1.在VS2015中,右键单击角色并启用诊断。结果:1分钟后超时。试了好几次。 2.使用powershell启用: $storage_name = "mystorageaccount" $key = "typedstoragekeyhere" $publicconfigpath = "C:\Temp\diagnostics.wadcfgx" $servicename = "cloudservicename" $storageC

正在尝试对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
结果:设置AzureServiceDiagnosticsExtension:BadRequest:扩展公共配置。。。对架构无效 然后 在底部: +CategoryInfo:NotSpecified:(:)[Set-AzureServiceDiagnosticsExtension],CloudException +FullyQualifiedErrorId:Hyak.Common.CloudException,Microsoft.WindowsAzure.Commands.ServiceManagement.Extensions.SetAzureServiceDiagnosticsExtensionCommand

我错过了什么

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

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

    (获取AzureServiceAvailableExtension-ExtensionName'PaaSDiagnostics'-ProviderNamespace'Microsoft.Azure.Diagnostics').PublicConfigurationSchema |输出文件-编码utf8-文件路径'WadConfig.xsd'

  • 在WorkerRole项目中添加一个XML文件,并进行您自己的诊断配置,然后将我们在步骤2中获得的WadConfig.xsd与XML文件关联起来。

  • 运行以下命令:

    $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诊断扩展。请参阅更多详细信息