Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure WebJob running old code

We have a bug in our WebJob running in our live environment, I have identified the bug and fixed it, this I can verify in our Dev-environment. I published my WebJob as a "Azure WebJob" to our live environment but the bug i still present. To add to the confusion the bug now just occurs sometimes. So for some reason the old code is running somewhere sometimes.

Can someone please help me understand this?

like image 397
Oskar Avatar asked Sep 22 '15 13:09

Oskar


2 Answers

I had a similar problem. We deploy using a stage environment in Azure and it turned out that the "old" WebJobs (running code with an old version of the entity framework model) where still running on the queue. These jobs where then fetching messages and consuming them. To add to the problem the exception was consumed in a try catch and the status of the WebJob was success.

Check if you have a stage environment (add -stage to the Webapp name) and if so go in to the Azure management portal and stop them.

Note, it is not enough to stop the Webapp, you must stop the WebJobs directly. This is done (in the new portal) under Settings->WebJobs and then right-clicking on the webjobs name selecting stop.

How to stop WebJob

like image 164
Martin Avatar answered Nov 05 '22 21:11

Martin


I spent ages looking into this problem. Turns out I had the web job project running in a console on my PC at work! No matter what I did on Azure the presence of this exe running and using the same storage for the web jobs meant that the old code running on my work PC picked up the jobs before Azure did. Easy fix: just make sure no exes are running outside of Azure!

like image 30
Rob Sedgwick Avatar answered Nov 05 '22 19:11

Rob Sedgwick