简体   繁体   中英

How do I create startup code for longrunning azure functions?

I plan to create a functions project that is always running, but responds to multiple triggers as per azure functions.

I know this can be done with webjobs, but can it be done with functions? If so how do I hook up a startup file as entry point for the longrunning (blocking) background task?

The exact point of Azure Functions is that they only run in response to events. If no events occur, they don't run.

Functions are not a good match for always-running background processes.

Please note, that Azure functions have a runtime hard limit of 10 minutes: https://docs.microsoft.com/en-us/azure/azure-functions/functions-scale .

That means, you should plan your function to only react to the different events, process it and is then disposed. Depending on your use case, you should consider other options - maybe you can tell some more about the goal you want to achieve.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM