I have loads of migrated VMs which have got multiple Azure log analytic workspaces tagged/configured at VM level.
So what if I don’t want to delete the LAW IDs configured at VM level (not in Azure portal) by giving the definite list as I don’t have a pre-known list of those multiple LAW rather just keep needed one by matching it within list and delete rest. I don’t find an option to do so in documentation! Only looking for doing this via powershell script
Thanks in advance!
By using a powershell script on Azure Doc. we are able to delete multiple LAW Ids by enlisting them, but then there are so many Vms and tenants that it is not possible to keep doing it like this.
2
Answers
We figured it out and below gets the job done on Target VM without having to log on to VM and removing the Workspace configuration ID which is not needed and retaining the one which matches, at VM level not at Azure portal level.
Relevant image - https://i.stack.imgur.com/Zk4jq.png
After reproducing from my end, I could able to achieve your requirement using the below script.
RESULTS: