Azure / Azure/Azure-Functions

Unreasonably high storage transaction activity (GetBlobProperties) causing increased cost of running Functions

Open
#2,417 22 comments 1 reaction 1 assignee Claimed by @bhagyshricompany View on GitHub
bug Needs: Attention :wave:
Dominant language
PowerShell
Stars
1.1k
Forks
215
Avg merge
4h 2m
Merged PRs (30d)
1

Description

I am running into the same issue as described in #2231, where my functions are generating some ridiculous and unexplained storage activity causing the cost of running functions to increase - more details below. It's worth noting that there were quite a few other similar issues raised in this repo (#2138, #1307, #832), so the problem is not necessarily new.

I also made a [comment](https://github.com/Azure/Azure-Functions/issues/2231#issuecomment-1772518721) in one #2231 but it didn't get any traction for a week so I decided to create a new issue, hoping that someone will have a look at this.

To set the context, I have a single .NET 7 Linux Azure Function v4 running on a consumption plan with a queue trigger. It's an open source project so the function code can be found [here](https://github.com/Progrunning/BoardGamesCompanion/tree/main/backend/BGC.Functions). As others who experienced this issue, I essentially have noticed that my bills were growing unexpectedly, which lead me to review where the cost is coming from. For some completely unknown reason to me I found out that there is close to ~700k `GetBlobProperties` operations happening in the storage over the span of a day.

![image](https://github.com/Azure/Azure-Functions/assets/8372764/d3def10e-1d2d-49b5-8cbe-d935affea68c)

To my huge disappointment, there doesn't seem to be a proper solution to fix this issue and neither there is a documentation to understand why the operations number is so high and how to control/reduce it. I browsed around and found a few "hacks" that allegedly helped others reduce numbers of operations and brought the cost of the storage down. Namely I have done the following:

- Downgraded v2 storage to legacy v1 as per recommendation by @nzthiago ([comment](https://github.com/Azure/Azure-Functions/issues/2231#issuecomment-1172644647))
- Deleted the `AzureWebJobsDashboard ` from the configuration ([SO comment](https://stackoverflow.com/a/60115446/510627))
- Ensured that I don't have this line `.AddJsonFile("local.settings.json", optional: true, reloadOnChange: true)` in the config code ([SO comment](https://stackoverflow.com/a/61259940/510627))
- Switched from Zip Deploy to Zip Deploy to Run With Package ([docs](https://learn.microsoft.com/en-us/azure/azure-functions/run-functions-from-deployment-package#enable-functions-to-run-from-a-package)) as [per this comment](https://github.com/Azure/Azure-Functions/issues/2231#issuecomment-1193494111)

Unfortunately none of the above helped. The storage transaction numbers have not dropped one bit. I'm getting really annoyed and helpless. It is frustrating, to say the least, that there is this "hidden" cost of running functions that is not documented anywhere, which misleads developers into thinking that they can run something inexpensively in Azure. It also amazes me that this has not been properly addressed for such a long time - the first comments that I found relating to this issue were made around 2018. That said, I still hope that someone will be able to help me out.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.