Azure Function App Setting and Container Size not supported error

Page content

Intro

I deployed an Azure function using ARM template and then tried to manually add an application setting in the portal.

Got the following error message:

Updating web app settings

The specified container size is not supported. Use one of these container sizes: 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960, 1024, 1088, 1152, 1216, 1280, 1344, 1408, 1472, 1536.

Searched on the internet, found this issue: https://github.com/Azure/azure-cli-extensions/issues/467

Went to Azure resource explorer and located my application. In the configuration of my site i found the following setting:

"containerSize": 0,

As suggested in the issue on githup the following Azure Cli command can be used to fix it but I wanted to know more ofcourse!

az functionapp update --name xxxxxxxx --resource-group xxxxx --set containerSize=1536

What is this value? Why do the portal think I need it?

The only thing that seems to be changing with the ContainerSize property is the environment variable WEBSITE_MEMORY_LIMIT_MB.

A fair bit of searching the internet I found this old blog post on Making Azure Functions more “serverless”.

It appears that back in the days, the amount of memory set here was the amount you were billed for. If I understand this correctly, the function runtime does not look at this setting at all any more so it could problably be set to any of the valid values in the error message. From now on I’ll just make sure to set it to 1536 which is the value set when I create a function app in the portal.