Stop an Azure WebJob

After a couple of failures due to Azure WebJobs not stopping when I thought they were going to, I figured out the only fail safe (?) option that will stop both Triggered and Continuous WebJobs. Not just that: It’s dead easy!

You can try to stop the App Service itself, but for some reason that does not apply to the WebJobs, and God only knows why. Stopping an individual Continuous WebJob can be done from the Azure Portal, but what about stopping multiple WebJobs including a Triggered one? I’ve even experienced that deleting a WebJob didn’t stop it, I’ve actually seen that multiple times.

To stop all WebJobs, both Triggered and Continuous, add WEBJOBS_STOPPED with the value 1 via “Configuration” / “Application settings” in the Azure Portal. As far as I’m concerned this has worked beautifully every time I’ve tried it.

Exceptions

I ran across a good post about exception handling here.

It got me thinking about my own way of handling exceptions in relation to what in the article is described as best practices (The term “best practices” is a bit of a rabbit hole in itself, but I’ll save that for another time).

Almost all of the things in the article I’m already doing or know about, but the thing that was most interesting was the part about decorating exceptions, – I had no idea that was a thing!

Most of the time, when debugging applications, I know from where the exception is being thrown but I wish I had some more context about it afterwards. This is where the decorating part can be quite handy. Keeping a mental note about that the next time I’m dealing with exceptions.

My adventures in programming

Depending on how you choose to see it, I either started programming around 1996 or 2016. Back in 1996 I started to learn HTML (It actually was considered programming back then, mind you), in 2016 I took the leap and became a full time C# developer working exclusively with Microsoft Azure.

What I did in the twenty years in between, and why I pursued a career in programming, is probably going to be explained in due time.

For now, welcome to my adventures in and around programming!