Hello @Ashwini kumar ,
Thank you for reaching out to the Microsoft Q&A platform. Happy to answer your question.
The main issue here is not only with the extension "enablevmaccess". The reason for not being able to SSH in to this VM could be anything else like there is an issue with teh VM guest agent itself as this error indicates "VMAgentStatusCommunicationError"
You will not be able to uninstall this extension in case the agent itself is not running as uninstall workflow communicates with the guest agent. This extension is used for resetting the password for VM. So, I suggest focussing on the SSH issue first and then you can fix guest agent issue then the extension issue. Adding troubleshooting steps to fix the SSH issue
Quick troubleshooting steps:
Note: After each troubleshooting step, try reconnecting to the VM.
- Reset the SSH configuration.
- Reset the credentials for the user.
- Verify the network security group rules permit SSH traffic.
- Ensure that a Network Security Group rule exists to permit SSH traffic (by default, TCP port 22).
- You cannot use port redirection / mapping without using an Azure load balancer.
- Check the VM resource health.
- Ensure that the VM reports as being healthy.
- If you have boot diagnostics enabled, verify the VM is not reporting boot errors in the logs.
- Restart the VM.
- Redeploy the VM.
Reference: https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection
For installation of Vmaccessextension using PS, you can follow https://learn.microsoft.com/en-us/powershell/module/az.compute/set-azvmaccessextension?view=azps-7.3.2
*If the answer provided on this thread was helpful, please kindly click on **"Accept Answer" and upvote it. If you have extra questions about this answer, please click "Comment" and write your query.**
What is the impotance of accepting answers in case they helped you:-
You as original poster by accepting answers will be helping other community members in finding the appropriate solutions in an effective way.*