Allow ICMP (Ping) on Azure VM
When you create a VM on Azure, the ICMP protocol (Ping) is blocked (Deny) by the Windows Firewall on the VM. This means that by default, you won't be able to ping your VM to check its connectivity. Pinging is a useful tool for diagnosing network issues and ensuring that your VM is reachable.
In this article, we will guide you through the steps to allow ICMP (Ping) traffic to your Azure VM by creating a new firewall rule. This can be done either directly within the VM or through the Azure portal's run command feature. Follow the instructions below to enable ICMP (Ping) on your Azure VM.

To enable ICMP (Ping) on your VM, execute the following command either directly within the VM or through the Azure portal's run command feature:

1New-NetFirewallRule -DisplayName "ICMP Allow Ping V4" -Direction Inbound -Protocol ICMPv4 -Action Allow
After the script execution completes, you should be able to successfully ping your VM.

Enjoy!