I am trying to check availability of an IoTHub using Ping,
public async Task<bool> CheckAvailabilityAsync(string url)
{
if (string.IsNullOrEmpty(url)) return false;
Ping ping = new Ping();
try
{
var result = await ping.SendPingAsync(url);
return result.Status == IPStatus.Success;
}
catch (Exception ex)
{
return false;
}
}
here url is “notavilableiothubName.azure-devices.net”.
look like ICMP is not supported for outbound ! What is the best way to achieve this ! Is there a native availability check for iothubs?