There is going to be some times that you may restore a VM from a snapshot and the vm effectively is crashed its relationship with the domain since the snapshot was maybe performed long ago
In cases like this whether Remote desktop may not be available we should be able to re-join the machine using wmi queries in the azure vm console . In my case I have a set of policies that for security reasons Local Admin cannot remote into a VM using remote desktop wich creates a pickle when restoring VMS from snapshots.
Use the Serial console option azure to connect into the vm
ch -si 1 ( channel 1 )
$computer = Get-WmiObject Win32_ComputerSystem
$computer.UnjoinDomainOrWorkGroup(“LocaladminPassword”, “LocalUser”, 0)
Now you should be able to re-join the VM into the domain using remote desktop