使用Role参数调用Set-AzureServiceDiagnosticsExtension失败

我正在尝试使用Azure Power
shell cmdlet和Set-AzureServiceDiagnosticsExtension命令在已部署的云服务上设置Azure诊断:

Set-AzureServiceDiagnosticsExtension -StorageContext $storageContext -DiagnosticsConfigurationPath $diagnosticsConfiguration.FullName -ServiceName $serviceName -Slot Production -Role "MyService.Web"-Verbose

这样做我收到以下错误

Exception: Microsoft.WindowsAzure.CloudException: BadRequest: The extension ID
MyService.Web-PaaSDiagnostics-Production-Ext-0 is invalid.
   at Microsoft.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task
task)
   at Microsoft.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccess(Task
task)
   at Microsoft.WindowsAzure.HostedServiceOperationsExtensions.AddExtension(IHo
stedServiceOperations operations, String serviceName,
HostedServiceAddExtensionParameters parameters)
   at Microsoft.WindowsAzure.Commands.ServiceManagement.Extensions.ExtensionMan
ager.AddExtension(HostedServiceAddExtensionParameters extensionInput)
   at Microsoft.WindowsAzure.Commands.ServiceManagement.Extensions.ExtensionMan
ager.InstallExtension(ExtensionConfigurationInput context, String slot,
ExtensionConfiguration extConfig)
   at Microsoft.WindowsAzure.Commands.ServiceManagement.Extensions.SetAzureServ
iceDiagnosticsExtensionCommand.ExecuteCommand()
   at Microsoft.WindowsAzure.Commands.ServiceManagement.Extensions.SetAzureServ
iceDiagnosticsExtensionCommand.OnProcessRecord()
   at Microsoft.WindowsAzure.Commands.Utilities.Common.CloudBaseCmdlet`1.Proces
sRecord()
   at System.Management.Automation.Cmdlet.DoProcessRecord()
   at System.Management.Automation.CommandProcessor.ProcessRecord()
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorExcep
   tion
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorExceptio
   n,UpdateDiagnosticsBuildStep.ps1

当我不使用“-Role”参数但后来我必须在调用Set命令之前为每个角色调用Remove-AzureServiceDiagnosticsExtension时,它会为脚本执行时间增加2-3分钟.

Role参数与Azure Cloud Service中的角色名称匹配.难道我做错了什么?

最佳答案 这不喜欢.在角色名称中

更改为下划线,它将起作用

它是powershell中的一个错误,他们下次会修复它

点赞