I have the following Powershell command
Set-AzVMExtension -ExtensionName "MicrosoftMonitoringAgent" `
-ResourceGroupName "rg-xxxx" `
-VMName "vm-xxxx" `
-Publisher "Microsoft.EnterpriseCloud.Monitoring" `
-ExtensionType "MicrosoftMonitoringAgent" `
-TypeHandlerVersion "1.0" `
-Settings @{"workspaceId" = "xxxx" } `
-ProtectedSettings @{"workspaceKey" = "xxxx"} `
-Location "uksouth"
which successfully replaces all Log Analytic Workspaces on the VM with the one I have configured in the command.
What I want to do is only add the workspace without replacing the ones already configured.
ARM has the same behaviour. It looks like if there is one workspace already then this gets overwritten, if there are two workspaces there, one of them gets overwritten.
Does anyone know any method within Powershell to only add a workspace and not overwrite?
Thanks,
Neil.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…