Azure Functions: is a cloud service available on-demand which provides all the continually updated infrastructure and resources needed to run your applications. You focus on the pieces of code that matter most to you, and Functions handles the rest. Functions provides serverless compute for Azure. You can use Functions to build web APIs, respond to database changes, process IoT streams, manage message queues, and more.
KEDA: is a Kubernetes-based Event Driven Autoscaler. With KEDA, you can drive the scaling of any container in Kubernetes based on the number of events needing to be processed.
Framework | Version |
---|---|
.Net | net6.0 |
AzureFunctions | v4 |
Keda | 2.0 |
In this repo, I've tried to solve some common issues on Azure Functions developing and deploying using Kubernetes and Keda.
- Use appsetting.json
- Use Dependency injection in startup
- Map request body in the HttpTrigger and DurableFunction
- Create YAML file for Keda based on the azure function types
- Azure Function Core Tools v4.
- An Azure Subscription (to host the storage queue). A free account works great - https://azure.com/free
- Kubernetes cluster (can be AKS, GKE, EKS, OpenShift etc.) and
kubectl
pointing to your Kubernetes cluster (for AKS). - Docker and a Docker registry
Follow the instructions to deploy KEDA in your cluster.
To confirm that KEDA has successfully installed you can run the following command and should see the following CRD.
kubectl get customresourcedefinition
NAME AGE
scaledobjects.keda.sh 2h
scaledjobs.keda.sh 2h
- Add other Azure function types (don't hesitate if you want to contribute and add other functions)