November 23, 2017 Greg

Things to know when working with Azure Functions

What are my hosting options for Azure functions?

There are two types of Azure Functions hosting plans and they both have different behaviors and pricing models.

The first and most common hosting plan is the Consumption Plan that will dynamically and automatically scale the compute and memory resources needed at runtime to meet the demand. Pricing is based on the amount of executions and resource consumptions in GB-s computed as a combination of execution time and memory size.

The second hosting plan is the usual App Service plan that we are used to see in many other Azure resources. This type of plan is useful for long-running tasks or to leverage Azure Function at no extra cost by using existing underused servers. Like always, App Service plan can manually scale out or up as you see fit.

Why is my azure function execution timing out?

Under a Consumption Plan Azure Function timeouts after 5 minutes, this is by design. You may consider moving the long running processing outside of the azure function or switching from a Consumption Plan to an App Service plan.

Why not schedule workload directly in my site or web service?

There are some great Third-Party software like Hang fire out there that do an excellent job at scheduling tasks, providing visibility and monitoring on execution state. Custom scheduling and third-party solutions are well suited for Windows services.

For websites and web services, that scheduling approach is more fragile since the application pool can shut down, when unused or scale out when overused, leading to unreliable execution schedule especially when hosting in the cloud.

Are Azure Functions the one-stop shop for scheduling now?

No, you may also want to consider webjobs to run background processing or schedule jobs in your Azure App Service. They are particularly good to run maintenance scripts like PowerShell or trigger event based work.

Tagged: ,

EXPERTISE IS ONLY ONE CLICK AWAY!

We invite you to contact us for more information
about our services.