Hi @Imran Shah,
Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.
We understand from your query that you are experiencing an issue while trying to connect to the Virtual Machine and are receiving an error.
Try changing the network ISP and attempt to connect to the VM rule out any ISP-related issues.
Please make sure that you are trying to connect azure VM with username & password (must Case sensitive) that you specified when you created the virtual machine.
Verify that the VM's firewall is not blocking SSH traffic. Try connecting to the VM using a different SSH client or from a different location.
Please check the status of the VM Agent? If you're agent status is not ready, please troubleshoot by going through this: https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/linux/linux-azure-guest-agent
We would like to inquire if you have made any recent changes.
If the answer is helpful, please click "Accept Answer" and "Upvote it."
If you have any further queries, do let us know.