I have a service that runs as an Azure Webjobs and scales out as needed, it's a long running process that can take a few hours for each message on the Queue. It works fine the only issue is that it relies on a third party for a rest endpoint that due to various issues can be unavailable.
My code catches this error and I need it to wait for 10-15seconds before it tries again, and I used
Thread.Sleep(10000);
This works locally but when in Azure as a webjob it seems to Pause all instances of the webjob not just the one that is needing to wait.
Any ideas as to why? each instance is on a difference thread I believe but I am relatively new to WebJobs so can't be 100% sure so some guidance on that would be good as well.