hi there F. Butnariu)) thanks for posting this question, it's a real head-scratcher....
so u're hitting this 'bmsusererrorcontainerobjectnotfound' error when trying to enable backup on ur windows vm, right? the error usually pops up when azure backup can't find the vm in the recovery services vault's inventory. even if u swear u never backed it up before, sometimes azure gets... confused )at least to me).
go to ur recovery services vault. click on 'backup infrastructure' in the left menu. then select 'protected servers' under 'management servers'. look for ur vm in the 'azure backup agent' tab. if it's there (even as a ghost entry), delete it. this often clears up the confusion. microsoft docs azure backup troubleshooting guide
next, let's nuke any leftover metadata. open cloud shell or powershell
$vault = get-azrecoveryservicesvault -name "urvaultname"
$container = get-azrecoveryservicesbackupcontainer -containerType "azurevm" -status "registered" -vaultId $vault.id
if u see ur vm in the list, deregister it with
unregister-azrecoveryservicesbackupcontainer -container $container[0] -force -vaultId $vault.id
still no luck..... try to uninstall the backup extension manually from the vm. go to azure portal, find ur vm, click "extensions" under settings, and remove anything related to backup (might be called "iaasvmprovider" or similar). then reboot the vm for good measure. microsoft says this helps in stubborn cases: manage backup extensions
after all this, wait like 10 minutes (azure needs its coffee breaks too hahaha ) then try enabling backup again from scratch. start fresh from the vm's blade in the portal, not from the vault.
check if ur vm has any funky networking stuff going on. sometimes nsg rules or private endpoints block the backup service from doing its thing. the backup service needs outbound internet access or proper private link setup backup networking requirements
if none of this works... well, that's when u might need to open a support ticket. but 9 times outta 10, the steps above should get u past that pesky error. let me know how it goes....
cheers,
Alex
and "yes" if you would follow me at Q&A - personaly thx.
P.S. If my answer help to you, please Accept my answer
PPS That is my Answer and not a Comment