An Azure service that provides an event-driven serverless compute platform.
Samuel hi,
thanks for posting your question here )) i'll give u both microsoft specific fixes and some general tricks that might help elsewhere too.
for your concurrent processing limit, u got the right idea with 'functionAppScaleLimit' but let's tweak it further. in your host.json, add this under 'queues' section
"concurrency": {
"dynamicConcurrencyEnabled": false,
"maximumConcurrency": 2
}
this should force exactly 2 messages at a time https://learn.microsoft.com/en-us/azure/azure-functions/functions-host-json#queues
about the idle app not waking up - classic cold start issue with consumption plan. try adding 'alwaysReady' instances in your arm template
"siteConfig": {
"alwaysReady": [
{
"size": "small",
"count": 1
}
]
}
this keeps one instance warm https://learn.microsoft.com/en-us/azure/azure-functions/functions-infrastructure-as-code#alwaysready
for messages getting stuck mid-process, your visibilityTimeout '00:00:00' looks suspicious. set it to something like '00:10:00' (10 mins) to give your function time to finish. also check your function code for unhandled exceptions - they cause messages to reappear in queue.
as well check this - in your dockerfile, add these env vars
ENV WEBSITE_CONTENTAZUREFILECONNECTIONSTRING="" \
WEBSITE_CONTENTSHARE="your-functionapp-name"
this helps with cold starts on containerized functions. worth looking into.
when using python with azure functions, keep an eye on that threadpool count. '2' is good for your case, but sometimes bumping it to '4' helps with throughput. test different values ))
and one more thing - verify your storage account connection. queue triggers need solid storage connection. if its flaky, u get exactly these symptoms. this might help in other tools too when dealing with azure queues.
try these changes and see if it behaves better. let us know how it goes....
Best regards,
Alex
and "yes" if you would follow me at Q&A - personaly thx.
P.S. If my answer help to you, please Accept my answer