public void ThreadPoolCallback(Object threadContext) { try { int threadIndex = (int)threadContext; DateTime start = System.DateTime.Now; PerformCaluclations(); DateTime end = System.DateTime.Now; UploadResultsToBlobStorage(start, end); //Upload files and clean up! this.Queue.DeleteMessage(this.Message); } catch (Exception) { if (this.Message.DequeueCount > 1) { this.Queue.DeleteMessage(this.Message); } } IsDone.Set(); }