Enabling PING (aka ICMP) on Windows Azure roles

By default any web or worker role instance in Windows Azure has ping functionality disabled. I you want and need to ping your machines via ICMP (e.g v6) you need to enable it by opening up the respective firewall ports.

Since Windows Azure SDK 1.3 this is quite easy to do with a custom startup taks (see http://msdn.microsoft.com/en-us/library/gg456327.aspx for details on the topic).
Your startup tasks could run a script which uses the netsh command like this in an elevated context:

netsh advfirewall firewall add rule name="ICMPv6" dir=in action=allow enable=yes protocol=icmpv6

The startup task can be defined in the ServiceDefinition.csdef file:

<ServiceDefinition name="MyService" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition">
   <WebRole name="MyWebRole">
         <Task commandLine="EnablePing.cmd" executionContext="elevated" taskType="simple">
Hope this helps.