Open
Description
I have a blob-triggered Azure function, which is deployed on AKS with keda scaling based on the blob entries.
I used Azure/azure-functions-host#10624 to make each function accept only one blob item. The problem I have is that all created pods read the same file, but if I use queues-based triggers and scaling, different queue elements are read by different functions. According to my understanding, the blob trigger internally uses queues to do its tasks, so why is the behaviour different from having a blob trigger?
P.S.: I am moving the files to a different folder after the process is completed.
host.json
{
"version": "2.0",
"logging": {
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
"excludedTypes": "Request"
}
}
},
"extensions": {
"blobs": {
"maxDegreeOfParallelism": 1
}
},
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[4.*, 5.0.0)"
}
}
host: 2.0
"FUNCTIONS_WORKER_RUNTIME": "python",
"AzureWebJobsFeatureFlags": "EnableWorkerIndex",
"PYTHON_ISOLATE_WORKER_DEPENDENCIES": "1",
from blob_helper import initialize_blob_service_client,upload_dataframe_to_blob
import logging
app = func.FunctionApp(http_auth_level=func.AuthLevel.ANONYMOUS)
@app.function_name(name="PythonFunction")
@app.blob_trigger(
arg_name="myblob",
path="sheets/input/{name}", # Blob path for trigger
connection="DataLakeConnectionString"
)
keda
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: python-fuction-scaler
namespace: prod
spec:
scaleTargetRef:
name: python-fuction
minReplicaCount: 0
maxReplicaCount: 10
triggers:
- type: azure-blob
metadata:
blobContainerName: "sheets"
blobPrefix: "input"
connectionFromEnv: "DataLakeConnectionString"
targetBlobCount: "1"
authenticationRef:
name: secrets