0

Trying to add a Network Security Group to a Log Analytics Workspace, getting the following error. This used to work in version 5.0.0 but no longer works with 5.0.1.

Set-AzureRmDiagnosticSetting -ResourceId $NsgFrontendSubnet.Id -WorkspaceId $LogAnalyticsWorkspace.ResourceId -Enabled $true -Categories 'NetworkSecurityGroupEvent','NetworkSecurityGroupRuleCounter'

Set-AzureRmDiagnosticSetting : Exception type: ErrorResponseException, Message: The diagnostic setting 'service' doesn't exist., Code: ResourceNotFound, Status code:NotFound, Reason phrase: Not Found At PAT0056-NetworkSecurityGroupNew:764 char:764 +
+ CategoryInfo : CloseError: (:) [Set-AzureRmDiagnosticSetting], PSInvalidOperationException + FullyQualifiedErrorId : Microsoft.Azure.Commands.Insights.Diagnostics.SetAzureRmDiagnosticSettingCommand

Felix Bodmer
  • 291
  • 2
  • 16

1 Answers1

0

This seems to be a known bug reported on GitHub: https://github.com/Azure/azure-powershell/issues/6833

Only way to get around it is to revert to AzureRm.Insights 5.0.0

Felix Bodmer
  • 291
  • 2
  • 16