TLDR: A solution that lets you deploy a piece of code that’s executed when an event happens. That event can be an HTTP request, a timer that elapsed, a blob that was created or a bunch of other things. Also, in the Consumption plan, they timeout after max 10 minutes (5 by default), so choosing them for long tasks isn’t the best idea.
What’s so cool with it?
Well, many things, to name a few:
- You literally only need to write a function that does a bunch of stuff and you’re good to go.
- Using the various bindings, you can react to pretty much whatever happens.
- Obviously, the whole serverless-advantage package.
- Visual Studio offers great templates to get you started.
- No need to worry about scaling. Azure Functions scale automatically, and you only pay for what you use, even in the Consumption plan.
What’s the catch?
- They timeout early. You only get 10 minutes max (5 by default) in the Consumption plan. So beware of your async tasks, or consider using Durable Functions.
- Cold starts when they go idle can be frustrating. BUT! You can always accompany your function with a “wake me up” function, something like this:
|
|
Verdict
I love them and use them a lot, but I can’t neglect what they are intended to be used as. Short tasks, black boxes, data-in → data-out, is what Azure Functions are built for.
Disclaimer 1: URLs last checked 2022-10-12. Drop me a line if you find a broken link, please.
Disclaimer 2: It’s never my intention to create a parallel wiki. I try to write my own experiences and the way I see things, not copy official documentation or Stack Overflow.