If you are unable to administer an Azure VM because of RDP or SSH failures, you can troubleshoot the VM by attaching the OS disk as a data disk to a different Azure VM.
Using this approach allows you to edit the registry, view log files, and perform other tasks that work with file-system only access to the offline VHD. This allows you to troubleshoot the VM in Azure without downloading the VHD on-premises. This example shows how to edit the registry, using the example of disabling Network Location Awareness (NLA), which lets you see the logon screen when attempting to do an RDP logon so you can reset an expired password. But the same process would allow you to disable the guest firewall if you inadvertently blocked RDP or SSH. And more generally you can view the event logs to investigate a possible no-boot or hang issue.