Building a Serverless Middleware

Learn how to build the core of our serverless middleware architecture using Azure Functions.

The Function app

The Function app is written in PowerShell (Powershell Class) and uses the principles of OOP. This approach allows us to build modular, well-supported code with the flexibility to add or remove functions at any time. Why did we opt for PowerShell and not C# or JavaScript? The main reason is that a solution based on PowerShell can be used not only by developers, but also by cloud administrators and system engineers.

Our implementation

We will place our solution into a single Azure Function app container based on a consumption plan. This way, it will not use a lot of resource power, and if more CPU power or memory is required, it is possible to automatically scale it up.

Each function contains one run file that represents a function and a bindings configuration file where function triggers can be set up. The solution also contains common classes (modules) with code which can be reused across functions and operations related to cloud resources. For example, the AutomationAccountManager module contains the function to trigger runbook, etc.

You can see the project structure and component dependency below.

Get hands-on with 1400+ tech skills courses.