Hello @Elisha George ,
Thank you for reaching out to the Microsoft Q&A platform. Happy to answer your question.
Essentially, if the agent is not in a ready state, it is usually due to some corruption of the agent which can be resolved by simply manually reinstalling the agent.
Steps:
Find the guest agent in control panel-> add/remove programs-> under uninstall a program, look for Windows azure guest agent and uninstall it.
Incase of corruption in the guest agent, you will mostl likely don't see the agent in control panel. In such cases, you can download a latest version of guest agent set up from the following link and install it
Find more details on how to manually install guest agebt here
Also, please share if your VM was deployed from a specialized image. When deploying a VM from image, a manual installation is required for the Guest Agent as described here: Azure Virtual Machine Agent Overview - Azure Virtual Machines | Microsoft Learn. Is that the process that was used for this Guest Agent's installation?
For a Windows VM, the Agent Installer should take care of everything as long as the prerequisites listed here: https://learn.microsoft.com/en-us/azure/virtual-machines/extensions/agent-windows#prerequisites are followed.
Not being able to RDP into the VM may not be completely due to Guest agent in your case. That needs to be debugged from the support side. Guest agent logs are C:\WindowsAzure\logs which will help to understand the issue better.
Hope that helps.
Please "Accept as Answer" and Upvote if any of the above helped to help others in the community looking for remediation for similar issues.