My problem is that I have set some Azure policies to check if all my virtual machines are under backup but of course all machines VBA-xxxx created by Veeam don't need this and should be exclude.
So I create a tag named "No_Backup = yes" for such machines to be exclude of this policy.
I also created a script to auto assign the tag on all VMs starting with "VBA" in the "Veeam Backup Appliance Resource group"
Here is my script :
My concern is that I feel this is not the best way to do.$tags = @{"No_Backup"="Yes"}
$RID = Get-Azresource -ResourceGroupName "MYRG" | where-object ResourceType -like "Microsoft.Compute/virtualMachines" | where-object Name -match "VBA" | select ResourceId
Update-AzTag -ResourceId $RID.ResourceId -tag $tags # +merge
- First the Name “VBA” may change
In my mind the tag assignment configuration should be possible through the web interface of the Appliance in the Instance configuration tab.
Is there any other trick to do this ?
Thanks again.