Overwriting Autoscale Rules Of Azure App Service Plan By The Azure Function App?

78 Views Asked by At

I have an Azure function app that is under a Dedicated plan (Azure App Service Plan P1V2).

The Azure Function App has a Queue Trigger function for Azure Storage Queues.

I'm looking to approximate FIFO as close as possible, I realize true FIFO is not guaranteed with Azure Storage Queues, but the documentation also states that Azure Storage Queues and Queue triggers typically go follow first in first out. (see "Additional Information" https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-azure-and-service-bus-queues-compared-contrasted#additional-information)

my host.json is the following:

{
  "version": "2.0",
  "extensions": {
    "queues": {
      "batchSize": 1,
      "maxDequeueCount": 10,
      "newBatchThreshold": 0
    }
  }
}

I have the app setting of WEBSITE_MAX_DYNAMIC_APPLICATION_SCALE_OUT = 1 which is supposed to limit the amount of VMs to 1 in an autoscale situation. (Side question: Is this app setting useless when the function app is under a dedicated plan? Is it only applicable for Consumption and Elastic Premium Plans? I ask because there is a similar sounding site config for Microsoft.Web/sites, arm template):

enter image description here

It seems that yes, my queue trigger is following one at a time execution, and I can't see "visible" evidence of more than 1 instance running (even during that high volume period).

However, the queue trigger still did not start in the order of queue insertion time. I have 3 messages being inserted, in a specific order, but the queue trigger processed message 3 before message 2 (again, high volume, there were other messages present)

I noticed my autoscale in the app service plan has some rules when CPU percentage gets too high, allowing up to a maximum of 10 instances, a minimum of 1, and a default of 1.

Can I somehow overwrite this autoscale at the app service plan level, by a setting at the Azure function level? Is this already being done by WEBSITE_MAX_DYNAMIC_APPLICATION_SCALE_OUT = 1??

0

There are 0 best solutions below