Hello @Anshuman Bajpai ,
Welcome to the Microsoft Q&A platform. Happy to answer your question.
Once a VM is successfully created either from terraform or via azure portal/CLI ways, you can check if the VM has booted successfullym through the boot diagnostics blade on azure VM blade. If booted successfully, you can further troubleshoot the VM connectivity issue by doing some basic troubleshooting, like
Ways to troubleshoot RDP issues
You can troubleshoot VMs created using the Resource Manager deployment model by using one of the following methods:
Azure portal - great if you need to quickly reset the RDP configuration or user credentials and you don't have the Azure tools installed.
Azure PowerShell - if you are comfortable with a PowerShell prompt, quickly reset the RDP configuration or user credentials using the Azure PowerShell cmdlets.
From azure Portal, you can check below and after each troubleshooting step, try reconnecting to the VM:
Reset Remote Desktop configuration.
Check Network Security Group rules / Cloud Services endpoints.
Review VM console logs.
Reset the NIC for the VM.
Check the VM Resource Health.
Reset your VM password.
Restart your VM.
Redeploy your VM.
For a detailed TSG, you can follow this doc
(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)