3
votes

We are making use of Azure Functions (v2) extensively to fulfill a number of business requirements.

We have recently introduced a durable function to handle a more complex business process which includes both fanning out, as well as a chain of functions.

Our problem is related to how much the storage account is being used. I made a fresh deployment on an account we use for dev testing on Friday, and left the function idling over the weekend to monitor what happens. I also set a budget to alert me if the cost start shooting up.

Less than 48 hours later, I received an alert that I was at 80% of my budget, and saw how the storage account was single handedly responsible for the entire bill. The most baffling part is, that it's mostly egress and ingress on file storage, which I'm entirely not using in the application! So it must be something internal by the azure function implementations. I've dug around and found this. In this case the issue seems to have been solved by switching to an App Service plan, but this is not an option in our case and must stick to consumption. I also double checked and made sure that I don't have the AzureWebJobsDashboard setting.

Any ideas what we can try next?

The below are some interesting charts from the storage account. Note how file egress and ingress makes up most of the activity on the entire account.

enter image description here

A ticket for this issue has also been opened on GitHub

2
Would be interested to know how much your budget alert was set for? We have some use cases for durable functions so this would be useful info.Matt
My budget was set for ~£30, which I am aware isn't a lot. But considering that this was over a weekend on an idling dev infrastructure, getting to £30 is a bit excessive.MarkB
Yeah I agree, and for a single orchestrator that’s significant, thanks.Matt

2 Answers

0
votes

The link you provided actually points to AzureWebJobsDashboard as the culprit. AzureWebJobsDashboard is an optional storage account connection string for storing logs and displaying them in the Monitor tab in the portal. The storage account must be a general-purpose one that supports blobs, queues, and tables.

For performance and experience, it is recommended to use APPINSIGHTS_INSTRUMENTATIONKEY and App Insights for monitoring instead of AzureWebJobsDashboard

When creating a function app in App Service, you must create or link to a general-purpose Azure Storage account that supports Blob, Queue, and Table storage. Internally, Functions uses Storage for operations such as managing triggers and logging function executions. Some storage accounts do not support queues and tables, such as blob-only storage accounts, Azure Premium Storage, and general-purpose storage accounts with ZRS replication. These accounts are filtered out of from the Storage Account blade when creating a function app.

When using the Consumption hosting plan, your function code and binding configuration files are stored in Azure File storage in the main storage account. When you delete the main storage account, this content is deleted and cannot be recovered.

0
votes

If you use the legacy "General Purpose V1" storage accounts, you may see your costs drop by up to 95%. I had a similar use case where my storage account costs exploded after the accounts were upgraded to "V2". In my case, we just went back to V1 instead of changing our application.

Altough V1 is now legacy, I don't see Azure dropping it any time soon. You can still create it using the Azure Portal. Could be a medium-term solution.

Some alternatives to save costs:

  • Try the "premium" performance tier (V2 only). It is cheaper for such workloads.
  • Try LRS or ZRS as the redundancy setting. Depends on the criticality of this orchestration data.

PS: Our use case were some EventHub processors which used the storage accounts for coordination and checkpointing.

PS2: Regardless of the storage account configuration, there must be a way reduce the traffic towards the storage account. It is just another thing to try to reduce costs.