This repository contains config and code to deploy and configure Azure Functions, which could be used to monitor Azure Load Balancers Backend Pools. Functions code is written on Go and uses managed identity to obtain an information about backend pools state.
For initial deployment you'll need:
- Azure subscription
- Linux environment (WSL also works) with installed Azure CLI and Azure Functions Core Tools, or alternatively, Azure Cloud Shell
- Microsoft Teams (will be used for a notification sending)
Before publishing the function you'll need to create a new incoming webhook in Teams and store its URL.
To start the deployment clone this repository and execute "function/deploy.sh" script with following arguments:
- Resource group name (which will be created/used for other resource deployment)
- Load Balancers resource ID (one or many)
- Teams Webhooks URL
If everything went according to plan, then a functions resource should be deployed and configured:
Function is triggered every 5 minutes and alerts if a pool is empty:
- https://github.com/MicrosoftDocs/azure-dev-docs/blob/master/articles/go/azure-sdk-authorization.md
- https://github.com/Azure-Samples/azure-sdk-for-go-samples/blob/master/internal/iam/authorizers.go
- https://github.com/Azure-Samples/functions-custom-handlers
- https://docs.microsoft.com/en-us/azure/load-balancer/load-balancer-standard-diagnostics
- https://azure.microsoft.com/en-us/blog/introducing-azure-load-balancer-insights-using-azure-monitor-for-networks/