title: Alert on failed links for inbound port for a specific process on a VM
body: <p>Let's say I have an Azure VM and there's a process called ABC.exe and it listens on port 34952. I want to monitor this port and perform some sort of health probe check for it. If it goes down, I want to be alerted.</p>
  <p>I looked into using Log Analytics Workspace, as you can create an Alert rule for it. Something like this:</p>
  <pre><code>VMConnection
  | where Direction == &quot;inbound&quot;
  | where ProcessName == &quot;ABC.exe&quot;
  | where DestinationPort in (34952)
  | where LinksFailed &gt; 0
  </code></pre>
  <p>The problem is, the &quot;LinksFailed&quot; metric is only available for Outbound connections, not Inbound. This is documented here - <a href="https://learn.microsoft.com/en-us/azure/azure-monitor/reference/tables/vmconnection" rel="nofollow noreferrer">https://learn.microsoft.com/en-us/azure/azure-monitor/reference/tables/vmconnection</a></p>
  <p>Otherwise, the above works well for identifying any failed links for specific ports and their processes.</p>
  <p>Is there another option I can use? I'm trying not to implement any solutions at the VM guest level. Ideally, if this can be done at the PaaS level, that would be great.</p>