title: How to get runtime status of queue triggered azure function?
body: <p>My azure function is calculating results of certain request jobs (cca. 5s-5min) where each job has unique jobId based on the hash of the request message. Execution leads to deterministic results. So it is functionally "pure function". Therefore we are caching results of already evaluated jobs in a blob storage based on the jobId. All great so far.</p>
  
  <p>Now if a request for jobId comes three scenarios are possible. </p>
  
  <ol>
  <li>Result is in the cache already => then it is served from the cache.</li>
  <li>Result is not in the cache and no function is running the evaluation => new invocation</li>
  <li>Result is not in the cache, but some function is already working on it => wait for result</li>
  </ol>
  
  <p>We do some custom table storage based progress tracking magic to tell if function is working on given jobId or not yet.</p>
  
  <p>It works somehow, up to the point of 5 x restart -> poison queue scenarios. There we are quite hopeless.</p>
  
  <p>I feel like we are hacking around some of already reliably implemented feature of Azure Functions internals, because exactly the same info can be seen in the monitor page in azure portal or used to be visible in kudu webjobs monitor page. </p>
  
  <p>How to reliably find out in c# if a given message (jobId) is currently being processed by some function and when it is not?</p>