4

I'm trying to set Azure diagnostics on a deployed cloud service using the Azure Powershell cmdlets and the Set-AzureServiceDiagnosticsExtension command:

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

Doing so I get the following error

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

It works when I don't use the "-Role" parameter but then I have to call Remove-AzureServiceDiagnosticsExtension for each role prior to calling the Set command which adds 2-3 minutes per role to the script execution time.

The Role parameter matches my role name in the Azure Cloud Service. Am I doing something wrong?

Evan
  • 5,925
  • 6
  • 33
  • 35
  • Any luck with a result? I am having the same issue. Mine works for the Worker Role but not a Web Role. – joe.feser Jan 15 '15 at 04:46
  • 4
    Nope, it's an acknowledged bug from Microsoft. You see can my question about the bug and their suggested workarounds here: http://blogs.msdn.com/b/kwill/archive/2014/12/02/windows-azure-diagnostics-upgrading-from-azure-sdk-2-4-to-azure-sdk-2-5.aspx – Evan Jan 15 '15 at 13:06
  • Do your custom logs transfer? I still can't get my nlog logs to transfer on the schedule. No errors in the event log. This is painful. – joe.feser Jan 16 '15 at 15:45
  • Yup all of my regular trace logs are working with the workaround of having to call `Remove` first before I can set the diagnostics config. – Evan Jan 16 '15 at 19:58

1 Answers1

2

This doesn't like . in the Role name

Change to underscore and it will work

Its a bug in powershell that they will fix next time

whatisthejava
  • 481
  • 3
  • 12
  • You can work around this by applying the diagnostics at the service level (just omit the -Role parameter) which will do it for all roles, if you try to apply it to a specific role with a "." in the name it fails. – Daniel Morritt Jul 31 '15 at 13:58