Hi @Riaz ,
browsing in the internet worked before on the VM?
You should check if there is a Network Security Group and/or firewall is blocking the internet traffic.
Have you checked if you could ping the name of the website, for instance www.microsoft.com. The name should be resolved to an IP.
Regards Andreas (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)