Azure / azure-functions-host

The host/runtime that powers Azure Functions
https://functions.azure.com
MIT License
1.95k stars 442 forks source link

Turning "off" timertrigger azure blob storage dependency #10275

Open bzuidgeest opened 4 months ago

bzuidgeest commented 4 months ago

Is your question related to a specific version? If so, please specify:

The latest

What language does your question apply to? (e.g. C#, JavaScript, Java, All)

c# (.net8 isolated)

Question

For what I can determine the timertrigger is completely dependent on (azure) blob storage.

Though I understand this is needed when scaling in azure to prevent the timers from running in multiple instances, this is useless when developing locally (always single instance) or possible undesirable when running containers on a local kubernetes installation.

Even when running on kubernetes I still need a azure blob storage for the timertrigger. I get that this is called "Azure" functions. But some of my employers (and I agree) don't like vendor lock-in. To accept this framework it should be able to run in a container without calling into Azure. And after all, your are still using MS tooling to create those functions. The locking is obviously needed when scaling, but I think there should be an interface/mechanism to redirect it to some local service or just turn in "off".

When looking thru the webjobs source this behavior might be derived from something similar to this extension: https://github.com/Azure/azure-webjobs-sdk-extensions/blob/dev/src/WebJobs.Extensions.Timers.Storage/TimersStorageWebJobsBuilderExtensions.cs But I cannot find where is is configured or done for azure-function. Let alone how to override it.

edit: I could always add quartz.net to an azure functions for timer related execution, but that just seems redundant and wastefull

kshyju commented 4 months ago

When developing locally, if you have Azurite installed on your machine, you can add "AzureWebJobsStorage": "UseDevelopmentStorage=true" to your local.settings.json file. Is this not working for you?

https://learn.microsoft.com/en-us/azure/azure-functions/functions-develop-local#local-storage-emulator

bzuidgeest commented 4 months ago

Your missing the point of my question. Yes it works with Azurite. But why is azurite needed when working with a single instance on a development machine? If I could just turn off the dependency it would be one less thing to run. Second it creates a dependency on azure blob storage for something simple like a timer trigger. If I wanted to deploy to a local kubernetes cluster, it would be nice if I could specify a local blob storage and not be dependent on running azurite in a local container. It's not meant for production work. Or just no blob storage and accept the time running on multiple instances of the container.

As I said I like azure functions as a framework. Really simple to create functions with it. But I dislike the fact that something simple like a timertrigger still has an azure dependency even when running locally or in a local cluster. I have customers that don't accept vendor specific features. If I could replace the default blobstorageclient in the azurefunctionshost, that concern would go away.