The following describes a proposed simple architecture that can be applied when creating Azure Functions that use timer triggers.
The application contains two assemblies: Func and Core.
- Func assembly’s main responsibility is handling the execution of code in the Processor within the Core assembly at a scheduled time. A timer trigger based function has no specific input or output so there is no contract model to create or return.
- Core assembly is the main part of the application and will be where most of the application’s code resides. It contains logic for performing the required operation including all related business logic such as domain model services and entities.
The main benefit of using an architecture such as this means the Core assembly has no knowledge of how it is being used. This is essentially a plug-in architecture where the Core application could be easily ported to other host application types; e.g. a console application.