WarmUp HTTPTrigger function on deploying to staging slot

1.5k Views Asked by At

When I deploy to a staging slot I see a WarmUp HTTPTrigger function. This is not a function that was supposed to add. Why is that?

enter image description here

1

There are 1 best solutions below

0
On

Documentation - https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-warmup?tabs=in-process&pivots=programming-language-csharp

From the above documentation -

A warmup trigger is invoked when an instance is added to scale a running function app. The warmup trigger lets you define a function that's run when a new instance of your function app is started.

Support for the warmup trigger is provided by default in all development environments. You don't have to manually install the package or register the extension.

The warmup trigger is only called during scale-out operations, not during restarts or other non-scale startups. Make sure your logic can load all required dependencies without relying on the warmup trigger. Lazy loading is a good pattern to achieve this goal.

More Info - https://learn.microsoft.com/en-us/azure/azure-functions/functions-premium-plan?tabs=portal#pre-warmed-instances

Similar SO (may give you a bit more idea on Warmup Function in Staging Slot) - https://stackoverflow.com/a/58301181/9276081

Overall, its a good thing to have but you should know when exactly it gets triggered i.e. during scale-out operations ONLY.