Can't SSH to Azure VM, Password reset failed with enablevmaccess error


  • I have a Azure VM running. I lost the SSH key, so i am trying to create a new SSH user with command

    boby@ok-pc-01:~$ az vm user update \
    >   --resource-group JIMSBOOKSTORE-ASR \
    >   --name jimsbookstore \
    >   --username boby \
    >   --ssh-key-value ~/.ssh/
    Operation 'PUT Extension' is not allowed on VM extension 'enablevmaccess' since it is marked for deletion. You can only retry the Delete operation (or wait for an ongoing one to complete).

    It fails. I check the extensuon in Azure Console, it says extensuon "enablevmaccess" unavailablke.

    I checked status of extensions, it says "VM Agent is unresponsive"

    I tried to delete extension "enablevmaccess" using Azure console, i get following error

    Failed to delete the virtual machine extension 'enablevmaccess'. Error: VM 'jimsbookstore' has not reported status for VM agent or extensions. Please verify the VM has a running VM agent and can establish outbound connections to Azure storage.

    How i fix this issue ?

    Friday, December 7, 2018 4:46 AM

All replies

  • Have you tried resetting this via the portal as well? 

    Portal -> Select VM -> Reset Password -> Reset SSH Public Key


    In order to use these features and the command you are using you need to have the VM agent working properly on your machine. So that could be the cause of the issue. 

    Another thing you could try would be the Serial Console Access feature

    This will allow you to access the console from the portal and reset the key from there. 

    Give that a go and let me know if it helps. 

    Friday, December 7, 2018 5:50 PM
  • On Azure Portal, reset password screen shows error

    The VM agent is either unavailable, or not installed, which may prevent VMAccess from running.

    I am able to see serial console. But i don't have password to login. Anyway i can reset password via serial console ?

    Friday, December 7, 2018 6:42 PM
  • This is CentOS 7 server. I rebooted the server, tried to get into grub for password reset. But grub is not showing. I tried pressing SHIFT  and ESC keys while server reboot, can't get into GRUB.
    Saturday, December 8, 2018 6:24 AM
  • Unfortunately without the VMAccess agent their is limited options to get back into the VM to change the password or the SSH key. 

    The solutions you are left with are 

    1) Download the VHD on prem, spin up in Hyper-V, Install the agent manually and reset the key, upload and rebuild the VM from that fixed VHD in Azure

    2) Delete the VM and attach it to a recovery VM in Azure. Manually install the agent and reset the key. Rebuild from the fixed VHD

    3) Delete the VHD and attach it to a recovery VM in Azure. Spin up the VHD in nested Hyper-V in Azure, reinstall the VM agent and change the key. Rebuild from the fixed VHD. 

    Additionally, if you have a backup of the VM in Azure Backup Services you could restore it from there. 

    If you need help performing these steps I would suggest you open a Technical Support Ticket to have an engineer walk you through the steps. If you don't have the ability to open a technical support ticket you can email me at and provide me with your SubscriptionID and link to this thread. I can enable your subscription for that request. 

    Monday, December 10, 2018 7:07 PM