Hi @Ritika Pandey Greetings! Welcome to Microsoft Q&A forum. Thank you for posting this question here.
Have you tried pinging the SQL Server from outside your VM? It could be possible that port on which your SQL server is hosted is not configured to accept external connections. Please take a look into the firewall configurations of your Azure VM and configure the port to allow inbound connections.
Let me know if this helps.