Hi @luis Miguel Perez lopez
By default, an Azure VM's network interface or the subnet it's connected to has an NSG that blocks all inbound ICMP traffic, including pings. Even if you have the File and Printer Sharing (Echo Request - ICMPv4-In) rule enabled in the Windows firewall, the Azure NSG might still block the pings.
Search for 'Network security groups' in your Azure Portal, or NSG linked to your subnet, go to 'Inbound security rules' and add ICMP form source any
The inbound ICMP Echo Request (used for pings) is usually allowed on the Windows Firewall by default, If you're not sure about this, check Windows Firewall inside VM
Get in touch if you need more help with this issue.
--please don't forget to "[Accept the answer]" if the reply is helpful--