Azure / Azure-Functions

1.11k stars 196 forks source link

Keda Scaler Support for Azure Functions Is Really Non-Existent even Though Func Tooling/Docs Gives the Impression that Scaling Is Supported #2465

Open SOFSPEEL opened 6 months ago

SOFSPEEL commented 6 months ago

Please describe the documentation request or issue. Be as specific as possible.

So have a function app and deploy it to aks via .yaml file using the func tooling as follows:

func kubernetes deploy --name processtransaction --registry blah --dry-run >deploy-processtransaction.yaml Below is an excerpt of the .yaml produced, here are the myriad of problems:

apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
  name: procreqs
  labels: {}
spec:
  scaleTargetRef:
    name: procreqs
  triggers:
  - type: cosmosdbtrigger
    metadata:
      connection: CosmosConnection
      leaseContainerName: leases
      leaseContainerPrefix: '%AZURE_FUNCTIONS_ENVIRONMENT%'
      containerName: ProcessingRequest
      databaseName: FundraisingGateway
      leaseDatabaseName: FundraisingGateway
  - type: timertrigger
    metadata:
      schedule: 0 0 0/1 * * *
  - type: timertrigger
    metadata:
      schedule: 0 10/20 * * * *
---

Expected Behavior

Actual Behavior

Scaling doesn't work, like for example the timertrigger mentioned above and orchestrations, meaning that pods don't scale up or down.

Steps to Reproduce the Problem

Run func on a function app with timertrigger kicking off an orchestration. Deploy it to aks. Watch no scaling will occur, what should happen is that replicas should go to zero, when timer not running, then scale up, then scale down when orchestration completes.

raorugan commented 5 months ago

Timer Trigger with KEDA scaling is supported in Azure Functions for Azure container apps . Check out this blog post - https://techcommunity.microsoft.com/t5/apps-on-azure-blog/announcing-the-release-of-workload-profile-and-managed-scaling/ba-p/4086313