I’m looking to setup auto scale rules in my Azure container apps, based on messages in an Azure Service Bus Topic by subscriptions.
I do see the documentation on how to setup autoscale based on messages in a topic (or queue), but I haven’t seen anything on how to scale by a specific subscription.
We have many subscribers to each topic, and most of the subscribers represent a separate container app.
I’ve followed the documentation here: https://learn.microsoft.com/en-us/azure/container-apps/scale-app?pivots=azure-cli, but there’s no mention about subscriptions.
2
Answers
It was a little tricky to find the right documentation, but I ended up finding KEDA scaling information here, that helped a lot: https://azure.github.io/aca-dotnet-workshop/aca/09-aca-autoscale-keda/
After exploring on your issue, I found that, currently there is no direct support for Azure Container Apps autoscaling based on messages in a specific subscription of a Service Bus Topic.
The reference MSDoc provided by you doesn’t have any information on scaling replicas based on multiple service bus subscriptions with their topics.
In order to increase the replicas based on the messages count, you can use Azure queue storage by specifying rule type as
--scale-rule-type azure-queue
with the help of managed identity trigger authentication.To just mention the subscription name in metadata, you can pass it along with the
--scale-rule-metadata
argument as shown in the below format.Reference:
Blog for more relevant information on message count in service bus.
Also check this MSDoc to use event sub scaler for subscription wise scaling with event hub functions..